Skip to content

Commit

Permalink
Merge branch 'develop' into refactor_saveNrestore
Browse files Browse the repository at this point in the history
  • Loading branch information
kalsky committed Apr 21, 2017
2 parents 16ea14f + ea1e63b commit 0b108f4
Show file tree
Hide file tree
Showing 6 changed files with 244 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[run]
omit =
*__init__*
*/profiler/*
*/tests/*
*/remap_child_resources_constants.py

[report]
omit =
*__init__*
*/profiler/*
*/tests/*
*/remap_child_resources_constants.py
Binary file not shown.
24 changes: 24 additions & 0 deletions Documentation/get_version_example.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# This file demonstrates implementation of get_version for Ericsson's IPOS/SEOS devices.

from cloudshell.helpers.scripts import cloudshell_scripts_helpers as helpers
from cloudshell.api.cloudshell_api import *
import re


def main():
api_session = helpers.get_api_session()
resource_details = helpers.get_resource_context_details()
reservation_id = helpers.get_reservation_context_details().id
# Run custom command on the device requesting the version
command_inputs = [InputNameValue('custom_command', str('show version'))]
cmd_out = api_session.ExecuteCommand(reservation_id, resource_details.name, 'Resource', 'run_custom_command',
commandInputs=command_inputs).Output
# Clean unwanted text, leaving only the version itself
match = re.search('(Ericsson IPOS Version|SmartEdge OS Version).+',cmd_out)
version=match.group(0)
version = version.replace('Ericsson IPOS Version ','')
version = version.replace('SmartEdge OS Version ','')
print str(version)


main()
69 changes: 69 additions & 0 deletions Documentation/gitlabrepo-import.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<ResourceManagementExportImport xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.qualisystems.com/ResourceManagement/ExportImportConfigurationSchema.xsd">
<Tags>
<Tag Name="Editable After Run (System Administrators)" />
<Tag Name="Editable After Run (Everyone)" />
<Tag Name="Configuration" />
<Tag Name="Setting" />
<Tag Name="Displayed In Diagram" />
<Tag Name="Link Configurations" />
<Tag Name="Variable Capability" />
<Tag Name="Constant Capability" />
<Tag Name="Topology Category" />
<Tag Name="Displayed In Route Creation" />
<Tag Name="Available For Abstract Resources" />
<Tag Name="Displayed In Search Filters" />
<Tag Name="Execution Server Selector" />
<Tag Name="Monitor Modifications" />
<Tag Name="Admin Only" />
<Tag Name="Displayed In Insight" />
</Tags>
<Attributes>
<AttributeInfo Name="GitLab URL" Type="String" DefaultValue="" IsReadOnly="false" IsCommand="false">
<Tags>
<TagName Name="Configuration" />
</Tags>
</AttributeInfo>
<AttributeInfo Name="GitLab Token" Type="String" DefaultValue="" IsReadOnly="false" IsCommand="false">
<Tags>
<TagName Name="Configuration" />
</Tags>
</AttributeInfo>
<AttributeInfo Name="GitLab Project Name" Type="String" DefaultValue="" IsReadOnly="false" IsCommand="false">
<Tags>
<TagName Name="Configuration" />
</Tags>
</AttributeInfo>
</Attributes>
<Modules>
</Modules>
<ResourceFamilies>
<ResourceFamily Name="Repository" IsMappableContainer="false" IsMappable="false" IsConnectable="false" IsLicenseCheckRequired="false" IsAllConnectedContainer="false" IsLockedByDefault="false" AcceptsMultipleConnections="false" Description="" SupportsMulticastMapping="false" SupportsLoopbackMapping="false" IsPowerSwitch="false" IsConsoleServer="false" ResourceType="Resource" IsAdminOnly="true" Searchable="true">
<AttachedAttributes />
<AttributeValues />
<Models>
<ResourceModel Name="GitLab" Description="" SupportsConcurrentCommands="false">
<AttachedAttributes>
<AttachedAttribute Name="GitLab URL" IsOverridable="true" IsLocal="true">
<AllowedValues />
</AttachedAttribute>
<AttachedAttribute Name="GitLab Token" IsOverridable="true" IsLocal="true">
<AllowedValues />
</AttachedAttribute>
<AttachedAttribute Name="GitLab Project Name" IsOverridable="true" IsLocal="true">
<AllowedValues />
</AttachedAttribute>
</AttachedAttributes>
<AttributeValues>
<AttributeValue Name="GitLab URL" Value="" />
<AttributeValue Name="GitLab Token" Value="" />
<AttributeValue Name="GitLab Project Name" Value="" />
</AttributeValues>
<ParentModels />
<Drivers />
</ResourceModel>
</Models>
</ResourceFamily>
</ResourceFamilies>
<DriverDescriptors>
</DriverDescriptors>
</ResourceManagementExportImport>
105 changes: 105 additions & 0 deletions Documentation/orch-sandboxDataModel.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@

<ResourceManagementExportImport xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.qualisystems.com/ResourceManagement/ExportImportConfigurationSchema.xsd">
<Tags>
<Tag Name="Editable After Run (System Administrators)" />
<Tag Name="Editable After Run (Everyone)" />
<Tag Name="Configuration" />
<Tag Name="Setting" />
<Tag Name="Displayed In Diagram" />
<Tag Name="Link Configurations" />
<Tag Name="Variable Capability" />
<Tag Name="Constant Capability" />
<Tag Name="Topology Category" />
<Tag Name="Displayed In Route Creation" />
<Tag Name="Available For Abstract Resources" />
<Tag Name="Displayed In Search Filters" />
<Tag Name="Execution Server Selector" />
<Tag Name="Monitor Modifications" />
<Tag Name="Admin Only" />
<Tag Name="Displayed In Insight" />
</Tags>
<Attributes>
<AttributeInfo Name="Storage Port" Type="Numeric" DefaultValue="0" IsReadOnly="false" IsCommand="false">
<Tags>
<TagName Name="Configuration" />
<TagName Name="Setting" />
</Tags>
</AttributeInfo>
<AttributeInfo Name="Storage Network configs Path" Type="String" DefaultValue="" IsReadOnly="false" IsCommand="false">
<Tags>
<TagName Name="Configuration" />
<TagName Name="Setting" />
</Tags>
</AttributeInfo>
<AttributeInfo Name="Storage username" Type="String" DefaultValue="" IsReadOnly="false" IsCommand="false">
<Tags>
<TagName Name="Configuration" />
</Tags>
</AttributeInfo>
<AttributeInfo Name="Storage password" Type="String" DefaultValue="" IsReadOnly="false" IsCommand="false">
<Tags>
<TagName Name="Configuration" />
</Tags>
</AttributeInfo>
<AttributeInfo Name="Orch Config file path" Type="String" DefaultValue="" IsReadOnly="false" IsCommand="false">
<Tags>
<TagName Name="Configuration" />
</Tags>
</AttributeInfo>
<AttributeInfo Name="Orch Disable Load Config" Type="Boolean" DefaultValue="False" IsReadOnly="false" IsCommand="false">
<Tags>
<TagName Name="Configuration" />
</Tags>
</AttributeInfo>
</Attributes>
<Modules>
</Modules>
<ResourceFamilies>
<ResourceFamily Name="Storage server" IsMappableContainer="false" IsMappable="false" IsConnectable="false" IsLicenseCheckRequired="false" IsAllConnectedContainer="false" IsLockedByDefault="false" AcceptsMultipleConnections="false" Description="" SupportsMulticastMapping="false" SupportsLoopbackMapping="false" IsPowerSwitch="false" IsConsoleServer="false" ResourceType="Resource" IsAdminOnly="true" Searchable="true">
<AttachedAttributes />
<AttributeValues />
<Models>
<ResourceModel Name="Generic FTP server" Description="" SupportsConcurrentCommands="false">
<AttachedAttributes>
<AttachedAttribute Name="Storage Port" IsOverridable="true" IsLocal="true">
<AllowedValues />
</AttachedAttribute>
<AttachedAttribute Name="Storage Network configs Path" IsOverridable="true" IsLocal="true">
<AllowedValues />
</AttachedAttribute>
<AttachedAttribute Name="Storage username" IsOverridable="true" IsLocal="true">
<AllowedValues />
</AttachedAttribute>
<AttachedAttribute Name="Storage password" IsOverridable="true" IsLocal="true">
<AllowedValues />
</AttachedAttribute>
</AttachedAttributes>
<AttributeValues>
<AttributeValue Name="Storage Network configs Path" Value="" />
<AttributeValue Name="Storage username" Value="" />
<AttributeValue Name="Storage password" Value="" />
<AttributeValue Name="Storage Port" Value="21" />
</AttributeValues>
<ParentModels />
<Drivers />
</ResourceModel>
</Models>
</ResourceFamily>
<ResourceFamily Name="Pool" IsMappableContainer="false" IsMappable="false" IsConnectable="false" IsLicenseCheckRequired="false" IsAllConnectedContainer="false" IsLockedByDefault="true" AcceptsMultipleConnections="false" Description="" SupportsMulticastMapping="false" SupportsLoopbackMapping="false" IsPowerSwitch="false" IsConsoleServer="false" ResourceType="Resource" IsAdminOnly="true" Searchable="true">
<AttachedAttributes />
<AttributeValues />
<Models>
<ResourceModel Name="Config Set Pool" Description="" SupportsConcurrentCommands="false">
<ParentModels />
<Drivers />
<AttachedAttributes />
<AttributeValues />
<ParentModels />
<Drivers />
</ResourceModel>
</Models>
</ResourceFamily>
</ResourceFamilies>
<DriverDescriptors>
</DriverDescriptors>
</ResourceManagementExportImport>
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,37 @@

Package for sandbox orchestration script functions

## Overview
The orchestration package should bring an out-of-the-box solution for our customer’s common use cases:
- Setting up the sandbox upon reservation
- Tearing down a sandbox
- Save a snapshot of a sandbox

### Setup
During the setup process the script will iterate over the resources and prepare them for the reservation.
- For each networking device:
- Perform health check (if exists)
- Load firmware (optional)
- Load configuration (optional)
- Re-run health check (if exists)
- VMs (when represented by Apps Deployment)
- Deploy apps
- Power on VM
- Activate all routes and connectors

### Teardown
During the teardown process the script will wipe the configuration from the networking devices and delete VMs bringing them back into “ready for use” state.
- For each networking device:
- Perform health check (if exists)
- Load firmware (optional)
- Load configuration (optiona)
- Re-run health check (if exists)
- VMs
- Delete/Power off VM
- Disconnect routes and connectors

### Snapshot
The user can save a snapshot of the sandbox. In the background, the script will save the sandbox as a new blueprint, and the current configuration of the devices and VMs will be saved for future use (reserving this saved blueprint will restore the configuration on the resources and the VM snapshots).
- Save the sandbox as a blueprint
- Save all the configuration files of the devices on the storage server (e.g. FTP server)

0 comments on commit 0b108f4

Please sign in to comment.