Giter VIP home page Giter VIP logo

qualisystems / vcentershell Goto Github PK

View Code? Open in Web Editor NEW
16.0 16.0 20.0 2.74 MB

:cloud::shell: This Shell adds VMWare vCenter as a cloud provider to CloudShell. Why is this Open? :cloud::shell: CloudShell cloud providers come out of the box and cannot be extended or modified independently. However, feel free to take a look at our code to better understand how things work under the hood. If you like you can experiment with our sofware, but please make sure you contact us if you need new cloud providers that would be supported in your production CloudShell deployment!

Home Page: http://www.quali.com

License: Apache License 2.0

Python 97.42% Batchfile 1.29% Shell 0.10% Makefile 1.19%

vcentershell's People

Contributors

alexazarh avatar alonagetzler avatar altern avatar asafc64 avatar borismod avatar costya-y avatar doppleware avatar evgenykhaliper avatar gilgald avatar gitter-badger avatar igoro1975 avatar kalsky avatar meiratwork avatar nahumtimerman avatar noamwegner avatar nochamp avatar ofirvardi avatar razaba avatar saklar13 avatar shnitselon avatar tomeradmon avatar xmig avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vcentershell's Issues

Test task: Test support multiple connections between VMs and VLANs

should be possible to connect a VM to multiple VLANs and a VLAN to multiple VMs

each connection should get its own NIC on the VM

connectivity JSON schema for bulk connect/disconnect request and response:
http://qs-srv-confluence:8090/display/QP/Connectivity+Schema

scenarios to check:

  1. one reservation with a VM connected to multiple VLANs (3 VLANs to start with)
  2. multiple concurrent reservations, each connecting VMs to the same VLAN
  3. one reservation with a VLAN connected to multiple VMs (3 VMs to start with)
  4. one reservation with a VLAN connected to multiple VMs and to a physical DUT

Create qualipy for Trunk

As a developer I would like to use recent version of TestShell API wrapped with qualipy.

Acceptance criteria:

  1. Tool that creates qualipy based on TestSehll API
  2. qualipy creation runs as part of CI process in TeamCity and publishes qualipy with appropriate version

Command Wrapper

we need to normalize the access to our commands:
1.make sure everything is logged
2.make sure command will get and close the connection properly closes after the command
3.make sure no command will have to implement the retrieving of it's own parameters

Refactor DestroyVirtualMachineCommand

  1. We need to refactor the method "getVCenterInventoryPathAttributeData". Its used by the "DestroyVirtualMachineCommand" class. It should return a model object instead of a dictionary.
    Note: update the unit tests in file "test_cloudshellDataRetrieverService" after the changes.
  2. Add unit test to DestroyVirtualMachineCommand execute command.

Component tests

As a developer I would like to be able to test the vCenterShell isolated from external dependencies, such as pyvmomi, CloudShell and vCenter.

Acceptance criteria:

  1. There are a few component tests and check vCenterShell as a whole, mocking external dependencies
  2. There is an article describing how it works and how to add a new test

Add "Get vNICs" command

as a user that wants to manually select a vNIC I want to get a list of vNICs to chose from

the command should be associated with the vCenter, should get as input the VM properties and as an output return a list of the vNICs name and network name if such configured on a vNIC

*TBD - don't we put it in the "VM details" of the deployed app?

Load vCenter information to CloudShell

As an admin I want to load all required information on the vCenter to CloudShell in order to support VM deployment and connectivity

flow:

  1. create a "vCenter" resource
  2. set "address", "user", "password"
  3. run "discover" command
  4. populates the templates list in the Template attribute on the Deployment service using (AddRestrictedValue)

ignore the below:
use existing autoload functionality, excluding:

  • no sub-resource under the vCenter
  • no creation of VM controller
  • no update of restricted values in services
  • no attributes will be populated

reference for current functionality - http://qs-srv-confluence:8090/display/QP/vCenter+Shell+3.0+-+Design

Support strings as variables

Currently the strings (attribute names, family/model names, input names etc.) are hard coded, we should use variables for that so it will be easier to change and customize the strings visible to the end user.

As a developer I would like to

  1. be able to access resource's properties as class properties
  2. to have a model validation to verify that the XML model fit the above class properties

Acceptance criteria:

  1. Model XML is commited to github
  2. Model Validator runs on every push to the repository and build fails if model does not fit classes and their properties

Support power on/off of a deployed VM

Add command to power on and power off a deployed app. The command should be on the vCenter and be a connected command so it will be available also on the deployed app. The command will get as an input the vCenter details and the VM UUID and should power on/off the VM. A message should be shown in the reservation output.

Power off here means - Hard Shutdown

the power on/off should update the live status on the deployed app

Use support for authentication token

As a user I would like to be able to access Quali API using encrypted authentication token.

How to demo:
Turn on authentication token mode and run command on an Execution Server

End-to-end automation

As a developer I would like to be able to test the shell with full end-to-end automation including CloudShell, ES that executes command on Python shell and real vCenter.

Acceptance criteria:

  1. End-To-End automation test runs as part of CI
  2. There is a document on confluence describing how automation works and how to add a new test

Automatic selection of the 1st available NIC

what's available? we might want to get all the vNICs, see what they're connected to and decide accordingly.

When connecting a route to a VM need to get all the connectors currently connected to the VM and select a NIC that isn't already used.

Got an error when running deploy app on VM Deployment

Deploy App ended with status Failed with error: Traceback (most recent call last):
File "C:\Users\nahum-t\AppData\Local\Temp\93e0cf32-dde4-4dc1-8244-9f205a3e11ce\Deploy App.py", line 9, in
appName = resourceDetails["name"]
AttributeError: ResourceContextDetails instance has no attribute 'getitem'

Cloudshell version was latest on trunk, package was created from development branch using run_packager

Add new entity of type "hosted on"

Per each deployed app this entity will hold information on the VM/s that the app is hosted on. The hosted on entity will be associated with (1) a list of attributes, (2) commands (=scripts), (3) list of NICs

This entity is a new CloudShell entity that will be associated with each Lab Resource (if exists), and GetResourceDetails API command will returns the hosted-on entity's deatils.

Implement pool logic for VLAN allcation

I want to manage a pool of items (VLANs,etc.) and use API to get items from the pool based on defined selection policy. For now we are implementing a 'numeric' pool, but the architecture should support other types of item (i.e IPs, strings, licenses etc.)

GetItemFromPool([PoolID], [reservationId], [Selection_Criterion], [Isolation_Level])
ReleaseFromPool([PoolID], [reservationId], [Selection_Criterion])

Examples:
GetItemFromPool("Auto-Global",reservationId, Criterion.NextUnusedNumeric, IsolationLevel.Exclusive) - Unavailable to this and other reservations
GetItemFromPool("Auto-Global",reservationId, Criterion.SpecificNumeric(2999), IsolationLevel.Reservation) - Unavailable to other reservations (available to this one)
GetItemFromPool("Auto-Global",reservationId, Criterion.SpecificRanges(2999, 3500), IsolationLevel.None) - Available to everyone

We also want to add to the reservation end event the logic to remove all pool items for that reservaiton Id.

Move VM deployment/deletion to the vCenter resource

the Deploy command on the deployment service should just call a "Deploy" command on the vCenter resource which should actually create the VM in the vCenter and return the VM Data.

the "delete" command on the VM resource should also move to the vCenter and be a connected command accessible on the deployed app resource (currently use regular connected command with physical connection) *note that scripts might not support connected commands and we'll need to wrap it in a driver

Support connect/disconnect operation (vSwitch)

Implement the connect/disconnect VLAN operations on the TBD to support VLAN (create port group, remove port group)
The input is the vnic to connect and the VM

the command should use the default vSwitch (defined on the vCenter, and the vCenter is defined in an attribute on the VM resource)

Add VM proxy service

As a developer I would like a convenient way to access VM object that supports caching.

Delete a VM that was created via CloudShell

As a user I want to destroy a VM I created in CloudShell using a "delete" command on the resource that represents it

flow:

  1. drag a "deploy vm" service
  2. input a template (string)
  3. click "deploy"
  4. a resource is created with the following attributes - UUID and vCenter
  5. click the "delete" command on the VM resource - the VM on the vCenter will be deleted and the resource that represents it in CloudShell will be deleted as well

note: the modeling of the resources in CloudShell is temporary

Deploy a VM on a vCenter and get its basic information back to CloudShell

As a user I want to deploy a VM from a specific template I input and view the VM in CloudShell

flow:

  1. drag a "deploy vm" service
  2. input a template (string)
  3. click "deploy"
  4. a resource is created with the following attributes - UUID and vCenter

note: the modeling of the resources in CloudShell is temporary
the VM should be powered On once deployed

Deploy a VM on a vCenter from an Image

As a user I want to deploy a VM from a specific image I input and view the VM in CloudShell

admin flow:

  1. create a new app
  2. select "deploy from image"
  3. input an image path (string). should support both local, shared and web location
  4. input a vCenter name
  5. save the app in a catalog

consumer flow:

  1. open an active reservation
  2. drag the app created by the admin
  3. click "deploy"
  4. a VM is created using the image configured in the app on the vCenter configured in the app
  5. the app changes to the "deployed app" and has the VM ID and vCenter name in its host properties.

Test performance of suspected areas

Test our 'get templates' method on the simulator and measure its performance with a large number of objects.
We need to get an understanding of how much this slows us down to see if its problem.
For example: Performance for 100/1000/5000 objects in the folder.

Support connect/disconnect operation (dvSwitch)

Implement the connect/disconnect VLAN operations on the TBD to support VLAN (create port group, remove port group)
The input is the vnic to connect and the VM

the command should use the default dvSwitch (defined on the vCenter, and the vCenter is defined in an attribute on the VM resource)

Here are the basic flow:
connect_vm_to_network(network_id, vm)
get_network (assume that network exists)
create_port_group
associate_vm_to_port_group

create_get_network(network_name or network_id)
return network

create_port_group(name, number_of_ports, vlan_type, dvSwitchName, vCenter)
return port_group

delete_port_group(vCenter, dvSwitchName, portGroupName)

Connnect(vlanId (220, 200-220), trunk/access, vm_resource_name)
- Port group name should be generated by
'vm_res_name Auto/Trunk VLAN Id/Range'

vCenter Resource

  • Default dvSwitch Path
  • Default dvSwitch Name
  • Default port group path

Logical_Resource
-HostedInfo <-----> vCenter
-vCenter Name
-UUID + Path

VLAN Service
[VLAN ID]
[Trunk/Access]

Create a VLAN Auto service that uses the pool logic for VLAN allocation

The attribute of this VLAN service should be:

  • Allocation Ranges (=this attribute's value will be configured by the administrator)
  • VLAN ID (user input)
  • Interface VLAN Mode (user input)
  • Virtual Network (=this attribute will hold the selected VLAN ID / range and won't be user input)
  • Isolation Level (=default for this service is Exclusive, non user input)

Research logging framework

As a developer I would like to be able to use logging framework with logging level

Logging level should be passed via environment variable: LOGGING_LEVEL

Logging should be initialized in the Bootstrapper and passed as dependency to all the classes

sdfsdfsdff

I think you should use an
<addr> element here instead.

Create a CLI tool to package a shell

The CLI tool should be called' ShellFoundry". For now we will implement a command called 'package' which expects the current directory to be the root directory of a shells project which we define to be structured as:
DataModel
- datamodel.xml
Resource Scripts
metadata.xml

The output should be a valid CloudShell package (zip file) which you can import into CloudShell.

Create a VLAN Manual service

The attribute of this VLAN service should be:

  • VLAN ID (user input, mandatory)
  • Interface VLAN Mode (none user input, default is Access)
  • Virtual Network (=this attribute will hold the selected VLAN ID / range and won't be user input)
  • Isolation Level (=default for this service is Shared, non user input, won't be changed)

flow 1 - connect

the flow for connect will be: (1) a connect command is called (2) it sends a GetItemFromPool request (3) it gets the selected VLAN ID (specific/range) as a result and put it on the "Virtual Network" attribute

if user input in "VLAN ID" is a specific number:
GetItemFromPool([PoolID=domainName], [reservationId], [Selection_Criterion=Criterion.NextUnusedNumeric(Vlan_ID)], [Isolation_Level])

if user input in "VLAN ID" is a range:
GetItemFromPool([PoolID=domainName], [reservationId], [Selection_Criterion=SpecificRanges(VLAN_ID)], [Isolation_Level])

*note: in case the "Virtual Network" attribute has a value than steps 2 and 3 in the flow above shouldn't happen

flow 2 - disconnect

the flow for disconnect will be: (1) a disconnect command is called (2) the "Virtual Network" attribute value is kept on the VLAN

note - the item isn't released from the pool in this case

flow 3 - service removal

once this service is removed from the reservation the flow will be: (1) check if there is a value in the "Virtual Network" attribute, if so (2) call ReleaseItemFromPool for the ID/range according to the value in the Virtual Network attribute and the ID of the service itself

Deploy a VM on a vCenter from an Image

As a user I want to deploy a VM from a specific template I input and view the VM in CloudShell

flow:

  1. drag a "deploy vm" service
  2. input a template (string)
  3. click "deploy"
  4. a resource is created with the following attributes - UUID and vCenter

note: the modeling of the resources in CloudShell is temporary
the VM should be powered On once deployed

Save vNic information on route

We should save the specific vNic used for a route on the route itself as an attribute. The attribute should be hidden to the end user

The attribute on the route should be called "Target Interface", it should be a string and associated with the rule "Link Configuration".

The value of this attribute will the name of the vNIC selected for this route.

motivation: know which vNIC to disconnect

Refactoring BaseCommand

we need to refactor BaseCommand:

  1. Remove the abstract execute function, we have no use for it
  2. Make sure all the shared functionality of the commands moves to it, like connecting to the VCenter.

Create deployment service that interacts with the app orchestrator

Create a service called "vCenter VM Template" that has a command (script) called "Deploy" which deploys a VM from a selected template. The interface of this command should be aligned with the App Orchestration flow.
Input - app deployment parameters
Output - hosted-on information to be used by the app orchestration (that builds the hotsed-on entity) - host name (=vCenter name), VM identifier (=UUID of VM), list of NICs, location (=path)

the deployment service should have the following attribute:
full path of the template (includes the name of the vCenter)

See the referenced link:
http://qs-srv-confluence:8090/pages/viewpage.action?pageId=4856595

Add a "Refresh IP" command on a VM

After a VM is deployed and powered On a "Refresh IP" command can be called to get back its IP and present it to the user and the deployed app's address.

The Refresh IP command should get the VM properties as input and set the IP as the deployed app's address.

This command should be associated with the vCenter

This command should be called as part of the App Deploy, after some delay time once the VM is powered on

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.