summaryrefslogtreecommitdiffstats
path: root/snaps/openstack/create_instance.py
AgeCommit message (Collapse)AuthorFilesLines
2017-11-20Refactoring of VmInstanceSettings to extend VmInstanceConfigspisarski1-139/+13
VmInstanceSettings, FloatingIPSettings and nova_utils have a runtime cyclical dependency. This patch reduces this dependency and deprecates the VmInstanceSettings and FloatingIPSettings class with snaps.config.vm_inst VmInstanceConfig and FloatingIpConfg classes JIRA: SNAPS-218 Change-Id: I95688130256bca1df4a5c347bdb741019ae0937e Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-11-20Refactoring of NetworkSettings to extend NetworkConfigspisarski1-3/+3
This also includes SubnetSettings extending to SubnetConfig and PortSettings extenting to Portconfig and neutron_utils have a runtime cyclical dependency. This patch reduces this dependency and deprecates the NetworkSettings, SubnetSettings, and PortSettings classes. JIRA: SNAPS-220 Change-Id: I996d73d9b910c075a6511a423f01d966f5b6fb74 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-11-08Adding tests for IPv6.spisarski1-1/+4
Included in patch: 1. Refactor Network domain object to include Subnet objects 2. Removed subnet members from OpenStackNetwork 3. Added exhausive IPv6 tests to neutron_utils_tests.py 4. Added two IPv6 integration tests to create_network_tests.py 5. Added two tests where VM instances have ports with IPv6 addresses 6. Updated docs JIRA: SNAPS-178 Change-Id: Id3e5448cb431d2acf47029244fe6773f3f29d368 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-11-02Added method to OpenStackHeatStack to return OpenStackRouter objects.spisarski1-3/+2
Continuation of the story SNAPS-153 for adding creator/state machine instances for OpenStack objects deployed via Heat. JIRA: SNAPS-173 Change-Id: Iac9138ef7827c10db1637447d3a909e714a0301b Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-10-24Implemented the ability to attach volumes to VM instances.spisarski1-22/+55
JIRA: SNAPS-198 Change-Id: I30bb92dabab64e6a8918fa5ab0de1bed359a147e Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-10-12Improved creator/state machine classes class hierarchy.spisarski1-50/+61
Created abstract superclasses for all classes responsible for deploying and maintaining the state of objects deployed to OpenStack which should help developers better understand the library. JIRA: SNAPS-183 Change-Id: I7651bd338f0d4e4086abbc11755e6be4f19058bd Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-09-08Enhanced launch.py app to support all types.spisarski1-2/+6
Added application support for users, projects, and security groups. In addition, added support for multiple credential sets so one can manage multiple projects potentially on multiple clouds. Added Jinja2 template support for substituting values in the template file with values contained in the environment file. Added ansible substituion value for a VM's floating IP. Changed credentials interface attribute's default value from 'admin' to 'public'. Added optional pre_sleep_time attribute to ansible execution that will wait for a given number of seconds prior to attempting to apply a playbook to a set of VMs. JIRA: SNAPS-4, SNAPS-5, SNAPS-6, SNAPS-26 Change-Id: I67b8d69a3b06a43631d80e8fe0c56e02773dbfbe Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-08-24Added method to return OpenStackVmInstance from Heat.spisarski1-12/+37
OpenStackHeatStack now can introspect the VMs that the template was responsible for deploying and return an instanitated instance of OpenStackVmInstance for each VM deployed. When the VM has a Floating IP, these instances have the ability to connect via SSH just like one created from scratch. JIRA: SNAPS-172 Change-Id: I5a7ed3a09bb871afc55c718aa80a9069b1eb4da7 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-08-07Refactored neutron_utils#get_router_by_name() to get_router()spisarski1-1/+2
Added a router_settings (RouterSettings) object parameter in addition to router_name for more robust query options. JIRA: SNAPS-163 Change-Id: I47672f531171d6ee0c90dabb6641640bf97c1d20 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-08-07Merge "Refactored neutron_utils#get_subnet_by_name() to get_subnet()"Steven Pisarski1-4/+5
2017-08-07Merge "Refactor server retrieval API calls."Steven Pisarski1-3/+3
2017-08-04Refactored neutron_utils#get_subnet_by_name() to get_subnet()spisarski1-4/+5
Renamed utility function and added a subnet_settings parameter to hold a SubnetSettings object to help make the query more robust by being able to leverage values on the settings object. JIRA: SNAPS-165 Change-Id: I226a1217dc4ba7bb50f7d985ecfaf3b7bc4f610b Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-08-03Refactor server retrieval API calls.spisarski1-3/+3
Refactored nova_utils#get_servers_by_name() to get_server() and include a VmInstSettings object in addition to the server_name parameter as well as only returning one VmInst object. JIRA: SNAPS-168 Change-Id: I30c22a36b07ce143ee8c1c76a77fd75f0062e4aa Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-08-03Refactored port retrieval to include PortSettigs.spisarski1-2/+2
Refactored neutron_utils#get_port_by_name to get_port while adding in a port_settings object for more robust query options. JIRA: SNAPS-162 Change-Id: I01222ad344224db94615859448ad05d8d5bc0c30 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-07-28Removed floating IP list from OpenStackVmInstance.spisarski1-24/+21
There was a list and dict both holding the same floating IP objects which has been problematic especially when trying to initialize the object with a VM instance that already exists. JIRA: SNAPS-149 Change-Id: If4af6dfef04a40b9c8cd7a8add484c9ec03f1ef8 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-07-27Ensure library and tests close all necessary resources.spisarski1-0/+1
The SNAPS-OO library and tests had left open files, ssh, and scp connections. These have all now been wrapped with try/finally blocks. JIRA: SNAPS-152 Change-Id: I43e09978b5c075bd78ff3279c0799556b8758878 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-07-18Created custom exceptions for VM instance creation.spisarski1-13/+33
Created VmInstanceSettingsError for errors creating VmInstanceSettings objects Created FloatingIpSettingsError for errors creating FloatingIpSettings objects Created VmInstanceCreationError for errors creating VM instances JIRA: SNAPS-132 Change-Id: I588ae34bf066c8440755a8bf4f3721b946533d99 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-07-18Merge "Added proper assertion config NIC test."Steven Pisarski1-2/+3
2017-07-17Added proper assertion config NIC test.spisarski1-2/+3
The test that exercises the OpenStackVmInstance class config_nic() now checks the Ansible return code. JIRA: SNAPS-124 Change-Id: I7840cd53eea2eacf7952d14be30870c8fa3aeab8 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-07-17Last task necessary to stop users from easily obtaining OS objects.spisarski1-10/+16
Changed external interfaces still exposing OpenStack created APIs to either return SNAPS-OO domain objects or objects contained on the OpenStack generated objects as to not leak implementation details that would eventually break the library when new API versions are released. JIRA: SNAPS-125 Change-Id: Iab6d6d298c4c5da68daed4b1b252313a1595a295 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-07-13Created domain classes for networks and subnets.spisarski1-23/+12
Created Network and Subnet domain classes so neutron_utils.py functions returning these types of objects will not be leaking out implementation details as each API version can change these data structures which is now being handled by the SNAPS neutron utility. JIRA: SNAPS-113 Change-Id: Id95dd0f8c2618c20a1a73a428abb95686dfa8251 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-07-13Created domain class for routers.spisarski1-2/+2
Created Router domain class so neutron_utils.py functions returning router objects will not be leaking out implementation details as each API version can change these data structures and this should all be handled by the SNAPS neutron utility. JIRA: SNAPS-115 & SNAPS-14 Change-Id: Ib6d36a735d835a6ed4ede489b14e33a261458fed Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-07-13Created domain class for ports.spisarski1-10/+7
Create Port domain class so neutron_utils.py functions returning port objects will not be leaking out implementation details as each API version can change these data structures and this should all be handled by the SNAPS neutron utility. JIRA: SNAPS-118 Change-Id: If031a094a9da284e2838691c3b3490359f710c61 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-07-11Created domain classes for security groups.spisarski1-3/+2
Created SecurityGroup and SecurityGroupRule classes so the neutron_utils for security groups will be returning objects of these types instead of the OpenStack objects returned by the API calls. JIRA: SNAPS-116 Change-Id: I76ed1f85f7d54b984fc6f6ac28cee7680a1109e5 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-07-06Added support for using '~' for SSH key location.spisarski1-5/+6
While testing changes, fixed problems found with querying for floating IPs which also required adding network data to the VMInst domain object. JIRA: SNAPS-85 Change-Id: I0ecf3a6885ce84fe14c4a6db09269c56dc0ad9fc Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-06-22Use neutron to create floating IPs.spisarski1-55/+29
This patch moves the floating IP creation out of nova and into neutron. Other changes include the use of domain objects for VM and Floating IP instances, addition of new nova_utils tests to exercise the create server functionality, and more PEP8 compliance. JIRA: SNAPS-92 Change-Id: I16c12b26b56008901633e90ae307586ad2045f9b Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-06-20Changes to VMInstanceSettings and FloatingIPSettings constructors.spisarski1-215/+310
Removed named parameters and replaced with kwargs. JIRA: SNAPS-97 Change-Id: I9e313c342a8fd5a99f3ce6e7274406f8a29b8c8b Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-06-06Added custom security group with ICMP and SSH rules.spisarski1-1/+1
This was done for all tests exercising floating IPs. Also added check to all of these tests to ensure the VMs all have received their private IP address via DHCP. JIRA: FUNCTEST-834 Change-Id: I88ae2fecc3f8e507641adf24cb65a0583f4db24c Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-05-19Fixed error in ansible_utils_tests.py and added ansible helperspisarski1-3/+14
method to the OpenStackVMInstance class. Test error was due to the image configuration having the incorrect user applied. The helper method will make it easier for adhoc ansible playbooks to be applied to running instances. JIRA: SNAPS-83 Change-Id: I6b229e0adb836dd3d5ea7b468d38d93f880589a2 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-05-16Added support for offline testingspisarski1-1/+4
Expanded the image_metadata used by the tests for overriding default images for not only supporting 3part images but also to support offline testing as required by Functest. JIRA: SNAPS-67 Change-Id: I6975e7b51fa879fe984af64402939c465df95184 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-05-16Ensure creators' constructors cannot raise exceptions.spisarski1-12/+10
While creating unit tests for vPing that is using SNAPS, exceptions can be raised when retrieving their respective OpenStack clients with incorrect credentials. Moved client retrieval to the create() method which one should expect exceptions to be raised. JIRA: SNAPS-81 Change-Id: Id8e4279f60b97704b25a89c6312dcf2ebdc3f459 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-05-08Modified code to support both Python 2.7 and 3.xspisarski1-15/+15
* Tested on Python 2.7.10 and 3.4.4 * Updated installation documentation JIRA: SNAPS-30 Change-Id: I94a37d218be8ea47bbbcfb560197737430fcb3ba Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-04-26Added support for Glance v2spisarski1-2/+2
Updated copyright date on new and edited files to current year. JIRA: SNAPS-66 Change-Id: I491157d6ced8bd9322f99272fc14e00168faaf29 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-04-13Ensuring each port manipulation test waits for the instance to become activespisarski1-1/+2
The problem with OpenStack is that when one attempts to delete an instance that is still spawning, it can take an inordinate amount of time for OpenStack to complete the request resulting in artifacts being left. JIRA: SNAPS-64 Change-Id: I39f33291e650c00a8b5a40cb0051b99b71923acf Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-04-10Problem found while working on FUNCTEST-577 where instances withspisarski1-1/+5
security groups need to be active before application. JIRA: FUNCTEST-577 Change-Id: I0d31b6afe4a378b3be85b335ba5f1568a0b26708 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-02-28Ensuring all instances must have ports/network.spisarski1-5/+14
Fixing the addition of security groups during server instantiation. JIRA: SNAPS-35 Change-Id: Id29b18ba1454538e2cd72ffa33ed3dc47120944f Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-02-15Initial patch with all code from CableLabs repository.spisarski1-0/+739
Change-Id: I70a2778718c5e7f21fd14e4ad28c9269d3761cc7 Signed-off-by: spisarski <s.pisarski@cablelabs.com>