def dvs_install(self):
        """Check that plugin can be installed.

        Scenario:
            1. Upload plugins to the master node
            2. Install plugin.
            3. Ensure that plugin is installed successfully using cli,
               run command 'fuel plugins'. Check name, version of plugin.

        Duration: 30 min

        """
        self.env.revert_snapshot("ready_with_1_slaves")

        self.show_step(1)
        self.show_step(2)
        plugin.install_dvs_plugin(self.env.d_env.get_admin_remote())

        cmd = 'fuel plugins list'

        output = list(self.env.d_env.get_admin_remote().execute(cmd)
                      ['stdout']).pop().split(' ')

        # check name
        assert_true(plugin.plugin_name in output,
                    "Plugin  {} is not installed.".format(plugin.plugin_name))
        # check version
        assert_true(plugin.DVS_PLUGIN_VERSION in output,
                    "Plugin  {} is not installed.".format(plugin.plugin_name))
        self.env.make_snapshot("dvs_install", is_make=True)
    def dvs_install(self):
        """Check that plugin can be installed.

        Scenario:
            1. Upload plugins to the master node
            2. Install plugin.
            3. Ensure that plugin is installed successfully using cli,
               run command 'fuel plugins'. Check name, version of plugin.

        Duration: 30 min

        """
        self.env.revert_snapshot("ready_with_1_slaves")

        self.show_step(1)
        self.show_step(2)
        plugin.install_dvs_plugin(
            self.env.d_env.get_admin_remote())

        cmd = 'fuel plugins list'

        output = list(self.env.d_env.get_admin_remote().execute(
            cmd)['stdout']).pop().split(' ')

        # check name
        assert_true(
            plugin.plugin_name in output,
            "Plugin  {} is not installed.".format(plugin.plugin_name)
        )
        # check version
        assert_true(
            plugin.DVS_PLUGIN_VERSION in output,
            "Plugin  {} is not installed.".format(plugin.plugin_name)
        )
        self.env.make_snapshot("dvs_install", is_make=True)
    def dvs_vcenter_smoke(self):
        """Check deployment with VMware DVS plugin and one controller.

        Scenario:
            1. Upload plugins to the master node
            2. Install plugin.
            3. Create a new environment with following parameters:
                * Compute: KVM/QEMU with vCenter
                * Networking: Neutron with VLAN segmentation
                * Storage: default
                * Additional services: default
            4. Add 1 node with controller role.
            5. Configure interfaces on nodes.
            6. Configure network settings.
            7. Enable and configure DVS plugin.
            8. Enable VMWare vCenter/ESXi datastore for images (Glance)
            9  Configure VMware vCenter Settings.
               Add 1 vSphere clusters and configure Nova Compute instances
               on conrollers.
            10. Deploy the cluster.
            11. Run OSTF.

        Duration: 1.8 hours

        """
        self.env.revert_snapshot("ready_with_1_slaves")

        plugin.install_dvs_plugin(
            self.env.d_env.get_admin_remote())

        # Configure cluster with 2 vcenter clusters
        cluster_id = self.fuel_web.create_cluster(
            name=self.__class__.__name__,
            mode=DEPLOYMENT_MODE,
            settings={
                "net_provider": 'neutron',
                "net_segment_type": NEUTRON_SEGMENT_TYPE,
                'images_vcenter': True
            }
        )
        plugin.enable_plugin(
            cluster_id, self.fuel_web, multiclusters=False)

        # Assign role to node
        self.fuel_web.update_nodes(
            cluster_id,
            {'slave-01': ['controller']}
        )

        # Configure VMWare vCenter settings
        self.fuel_web.vcenter_configure(cluster_id, vc_glance=True)

        self.fuel_web.deploy_cluster_wait(cluster_id)

        self.fuel_web.run_ostf(
            cluster_id=cluster_id, test_sets=['smoke'])
    def dvs_vcenter_smoke(self):
        """Check deployment with VMware DVS plugin and one controller.

        Scenario:
            1. Upload plugins to the master node
            2. Install plugin.
            3. Create a new environment with following parameters:
                * Compute: KVM/QEMU with vCenter
                * Networking: Neutron with VLAN segmentation
                * Storage: default
                * Additional services: default
            4. Add 1 node with controller role.
            5. Configure interfaces on nodes.
            6. Configure network settings.
            7. Enable and configure DVS plugin.
            8. Enable VMWare vCenter/ESXi datastore for images (Glance)
            9  Configure VMware vCenter Settings.
               Add 1 vSphere clusters and configure Nova Compute instances
               on conrollers.
            10. Deploy the cluster.
            11. Run OSTF.

        Duration: 1.8 hours

        """
        self.env.revert_snapshot("ready_with_1_slaves")

        plugin.install_dvs_plugin(self.env.d_env.get_admin_remote())

        # Configure cluster with 2 vcenter clusters
        cluster_id = self.fuel_web.create_cluster(name=self.__class__.__name__,
                                                  mode=DEPLOYMENT_MODE,
                                                  settings={
                                                      "net_provider":
                                                      'neutron',
                                                      "net_segment_type":
                                                      NEUTRON_SEGMENT_TYPE,
                                                      'images_vcenter': True
                                                  })
        plugin.enable_plugin(cluster_id, self.fuel_web, multiclusters=False)

        # Assign role to node
        self.fuel_web.update_nodes(cluster_id, {'slave-01': ['controller']})

        # Configure VMWare vCenter settings
        self.fuel_web.vcenter_configure(cluster_id, vc_glance=True)

        self.fuel_web.deploy_cluster_wait(cluster_id)

        self.fuel_web.run_ostf(cluster_id=cluster_id, test_sets=['smoke'])
    def dvs_vcenter_bvt(self):
        """Deploy cluster with DVS plugin and ceph storage.

        Scenario:
            1. Upload plugins to the master node
            2. Install plugin.
            3. Create a new environment with following parameters:
                * Compute: KVM/QEMU with vCenter
                * Networking: Neutron with VLAN segmentation
                * Storage: ceph
                * Additional services: default
            4. Add nodes with following roles:
                * Controller
                * Controller
                * Controller
                * Compute + CephOSD
                * Compute + CephOSD
                * Compute + CephOSD
                * CinderVMware + ComputeVMware
            5. Configure interfaces on nodes.
            6. Configure network settings.
            7. Enable and configure DVS plugin.
               Configure VMware vCenter Settings. Add 2 vSphere clusters
               and configure Nova Compute instances on conroller
               and compute-vmware.
            8. Verify networks.
            9. Deploy the cluster.
            10. Run OSTF.

        Duration: 1.8 hours

        """
        self.env.revert_snapshot("ready_with_9_slaves")

        plugin.install_dvs_plugin(
            self.env.d_env.get_admin_remote())

        # Configure cluster with 2 vcenter clusters and vcenter glance
        cluster_id = self.fuel_web.create_cluster(
            name=self.__class__.__name__,
            mode=DEPLOYMENT_MODE,
            settings={
                "net_provider": 'neutron',
                "net_segment_type": NEUTRON_SEGMENT_TYPE,
                'images_ceph': True,
                'volumes_ceph': True,
                'objects_ceph': True,
                'volumes_lvm': False
            }
        )
        plugin.enable_plugin(cluster_id, self.fuel_web)

        # Assign role to node
        self.fuel_web.update_nodes(
            cluster_id,
            {'slave-01': ['controller'],
             'slave-02': ['controller'],
             'slave-03': ['controller'],
             'slave-04': ['compute', 'ceph-osd'],
             'slave-05': ['compute', 'ceph-osd'],
             'slave-06': ['compute', 'ceph-osd'],
             'slave-07': ['compute-vmware', 'cinder-vmware']}
        )

        # Configure VMWare vCenter settings
        target_node_2 = self.node_name('slave-07')
        self.fuel_web.vcenter_configure(
            cluster_id,
            target_node_2=target_node_2,
            multiclusters=True
        )

        self.fuel_web.verify_network(cluster_id, timeout=60 * 15)
        self.fuel_web.deploy_cluster_wait(cluster_id, timeout=3600 * 3)

        self.fuel_web.run_ostf(
            cluster_id=cluster_id, test_sets=['smoke'])

        self.env.make_snapshot("dvs_bvt", is_make=True)
    def dvs_vcenter_bvt(self):
        """Deploy cluster with DVS plugin and ceph storage.

        Scenario:
            1. Upload plugins to the master node
            2. Install plugin.
            3. Create a new environment with following parameters:
                * Compute: KVM/QEMU with vCenter
                * Networking: Neutron with VLAN segmentation
                * Storage: ceph
                * Additional services: default
            4. Add nodes with following roles:
                * Controller
                * Controller
                * Controller
                * Compute + CephOSD
                * Compute + CephOSD
                * Compute + CephOSD
                * CinderVMware + ComputeVMware
            5. Configure interfaces on nodes.
            6. Configure network settings.
            7. Enable and configure DVS plugin.
               Configure VMware vCenter Settings. Add 2 vSphere clusters
               and configure Nova Compute instances on conroller
               and compute-vmware.
            8. Verify networks.
            9. Deploy the cluster.
            10. Run OSTF.

        Duration: 1.8 hours

        """
        self.env.revert_snapshot("ready_with_9_slaves")

        plugin.install_dvs_plugin(self.env.d_env.get_admin_remote())

        # Configure cluster with 2 vcenter clusters and vcenter glance
        cluster_id = self.fuel_web.create_cluster(name=self.__class__.__name__,
                                                  mode=DEPLOYMENT_MODE,
                                                  settings={
                                                      "net_provider":
                                                      'neutron',
                                                      "net_segment_type":
                                                      NEUTRON_SEGMENT_TYPE,
                                                      'images_ceph': True,
                                                      'volumes_ceph': True,
                                                      'objects_ceph': True,
                                                      'volumes_lvm': False
                                                  })
        plugin.enable_plugin(cluster_id, self.fuel_web)

        # Assign role to node
        self.fuel_web.update_nodes(
            cluster_id, {
                'slave-01': ['controller'],
                'slave-02': ['controller'],
                'slave-03': ['controller'],
                'slave-04': ['compute', 'ceph-osd'],
                'slave-05': ['compute', 'ceph-osd'],
                'slave-06': ['compute', 'ceph-osd'],
                'slave-07': ['compute-vmware', 'cinder-vmware']
            })

        # Configure VMWare vCenter settings
        target_node_2 = self.node_name('slave-07')
        self.fuel_web.vcenter_configure(cluster_id,
                                        target_node_2=target_node_2,
                                        multiclusters=True)

        self.fuel_web.verify_network(cluster_id, timeout=60 * 15)
        self.fuel_web.deploy_cluster_wait(cluster_id, timeout=3600 * 3)

        self.fuel_web.run_ostf(cluster_id=cluster_id, test_sets=['smoke'])

        self.env.make_snapshot("dvs_bvt", is_make=True)
    def dvs_vcenter_net_template(self):
        """Deploy cluster with DVS plugin, Neutron, Ceph and network template.

        Scenario:
            1. Upload plugins to the master node.
            2. Install plugin.
            3. Create cluster with vcenter.
            4. Set CephOSD as backend for Glance and Cinder.
            5. Add nodes with following roles:
                controller
                compute-vmware
                compute-vmware
                compute
                3 ceph-osd
            6. Upload network template.
            7. Check network configuration.
            8. Deploy the cluster.
            9. Run OSTF.

        Duration 2.5 hours

        Duration 180m
        Snapshot deploy_cinder_net_tmpl
        """
        self.env.revert_snapshot("ready_with_9_slaves")

        self.show_step(1)
        self.show_step(2)
        plugin.install_dvs_plugin(self.ssh_manager.admin_ip)

        self.show_step(3)
        self.show_step(4)
        cluster_id = self.fuel_web.create_cluster(name=self.__class__.__name__,
                                                  mode=DEPLOYMENT_MODE,
                                                  settings={
                                                      "net_provider":
                                                      'neutron',
                                                      "net_segment_type":
                                                      NEUTRON_SEGMENT_TYPE,
                                                      'images_ceph': True,
                                                      'volumes_ceph': True,
                                                      'objects_ceph': True,
                                                      'volumes_lvm': False,
                                                      'tenant': 'netTemplate',
                                                      'user': '******',
                                                      'password':
                                                      '******',
                                                  })

        plugin.enable_plugin(cluster_id, self.fuel_web)

        self.show_step(5)
        self.fuel_web.update_nodes(cluster_id, {
            'slave-01': ['controller'],
            'slave-02': ['compute-vmware'],
            'slave-03': ['compute-vmware'],
            'slave-04': ['compute'],
            'slave-05': ['ceph-osd'],
            'slave-06': ['ceph-osd'],
            'slave-07': ['ceph-osd'],
        },
                                   update_interfaces=False)

        # Configure VMWare vCenter settings
        self.show_step(6)

        target_node_1 = self.node_name('slave-02')
        target_node_2 = self.node_name('slave-03')
        self.fuel_web.vcenter_configure(cluster_id,
                                        target_node_1=target_node_1,
                                        target_node_2=target_node_2,
                                        multiclusters=True)

        network_template = self.get_network_template('default')
        self.fuel_web.client.upload_network_template(
            cluster_id=cluster_id, network_template=network_template)
        networks = self.generate_networks_for_template(
            template=network_template,
            ip_nets={'default': '10.200.0.0/16'},
            ip_prefixlen='24')
        existing_networks = self.fuel_web.client.get_network_groups()
        networks = self.create_custom_networks(networks, existing_networks)

        logger.debug('Networks: {0}'.format(
            self.fuel_web.client.get_network_groups()))

        self.show_step(7)
        self.fuel_web.verify_network(cluster_id)

        self.show_step(8)
        self.fuel_web.deploy_cluster_wait(cluster_id, timeout=180 * 60)
        self.fuel_web.verify_network(cluster_id)

        self.check_ipconfig_for_template(cluster_id, network_template,
                                         networks)
        self.check_services_networks(cluster_id, network_template)

        self.show_step(9)
        self.fuel_web.run_ostf(
            cluster_id=cluster_id,
            timeout=3600,
            test_sets=['smoke', 'sanity', 'ha', 'tests_platform'])

        self.check_ipconfig_for_template(cluster_id, network_template,
                                         networks)

        self.check_services_networks(cluster_id, network_template)
    def dvs_destructive_setup_2(self):
        """Verify that vmclusters migrate after reset controller.

        Scenario:
            1. Upload plugins to the master node.
            2. Install plugin.
            3. Configure cluster with 2 vcenter clusters.
            4. Add 3 node with controller role.
            5. Add 2 node with compute role.
            6. Configure vcenter.
            7. Deploy the cluster.
            8. Run smoke OSTF tests
            9. Launch instances. 1 per az. Assign floating ips.
            10. Make snapshot.

        Duration: 1.8 hours
        Snapshot: dvs_destructive_setup_2
        """
        self.show_step(1)
        self.env.revert_snapshot("ready_with_5_slaves")

        plugin.install_dvs_plugin(self.ssh_manager.admin_ip)

        self.show_step(2)
        cluster_id = self.fuel_web.create_cluster(
            name=self.__class__.__name__,
            mode=DEPLOYMENT_MODE,
            settings={
                "net_provider": 'neutron',
                "net_segment_type": NEUTRON_SEGMENT_TYPE
            }
        )
        plugin.enable_plugin(cluster_id, self.fuel_web)

        self.show_step(3)
        self.show_step(4)
        self.fuel_web.update_nodes(cluster_id,
                                   {'slave-01': ['controller'],
                                    'slave-02': ['controller'],
                                    'slave-03': ['controller'],
                                    'slave-04': ['compute'],
                                    'slave-05': ['compute']})
        self.show_step(6)
        self.fuel_web.vcenter_configure(cluster_id, multiclusters=True)

        self.show_step(7)
        self.fuel_web.deploy_cluster_wait(cluster_id)

        self.show_step(8)
        self.fuel_web.run_ostf(cluster_id=cluster_id, test_sets=['smoke'])

        self.show_step(9)
        os_ip = self.fuel_web.get_public_vip(cluster_id)
        os_conn = os_actions.OpenStackActions(
            os_ip, SERVTEST_USERNAME,
            SERVTEST_PASSWORD,
            SERVTEST_TENANT)

        security_group = os_conn.create_sec_group_for_ssh()

        network = os_conn.nova.networks.find(label=self.inter_net_name)
        instances = openstack.create_instances(
            os_conn=os_conn,
            nics=[{'net-id': network.id}],
            vm_count=1,
            security_groups=[security_group.name])
        openstack.verify_instance_state(os_conn)
        openstack.create_and_assign_floating_ips(os_conn, instances)

        self.show_step(10)
        self.env.make_snapshot("dvs_destructive_setup_2", is_make=True)
    def dvs_reboot_vcenter_2(self):
        """Verify that vmclusters migrate after reset controller.

        Scenario:
            1. Install DVS plugin on master node.
            2. Create a new environment with following parameters:
                * Compute: KVM/QEMU with vCenter
                * Networking: Neutron with VLAN segmentation
                * Storage: default
                * Additional services: default
            3. Add nodes with following roles:
                * Controller
                * Compute
                * Cinder
                * CinderVMware
                * ComputeVMware
            4. Configure interfaces on nodes.
            5. Configure network settings.
            6. Enable and configure DVS plugin.
            7. Configure VMware vCenter Settings. Add 1 vSphere clusters and
               configure Nova Compute instances on compute-vmware.
            8. Verify networks.
            9. Deploy cluster.
            10. Run Smoke OSTF.
            11. Launch instance VM_1 with image TestVM, availability zone nova
                and flavor m1.micro.
            12. Launch instance VM_2 with image TestVM-VMDK, availability zone
                vcenter and flavor m1.micro.
            13. Verify connection between instances: check that VM_1 to VM_2
                can ping each other.
            14. Reboot vcenter.
            15. Check that controller lost connection with vCenter.
            16. Wait for vCenter.
            17. Ensure that all instances from vCenter displayed in dashboard.
            18. Run Smoke OSTF.

        Duration: 2.5 hours

        """
        self.env.revert_snapshot("ready_with_5_slaves")

        self.show_step(1)
        plugin.install_dvs_plugin(self.ssh_manager.admin_ip)

        self.show_step(2)
        cluster_id = self.fuel_web.create_cluster(
            name=self.__class__.__name__,
            mode=DEPLOYMENT_MODE,
            settings={
                "net_provider": 'neutron',
                "net_segment_type": NEUTRON_SEGMENT_TYPE
            }
        )

        self.show_step(3)
        self.show_step(4)
        self.show_step(5)
        self.fuel_web.update_nodes(cluster_id,
                                   {'slave-01': ['controller'],
                                    'slave-02': ['compute'],
                                    'slave-03': ['cinder-vmware'],
                                    'slave-04': ['cinder'],
                                    'slave-05': ['compute-vmware']})

        self.show_step(6)
        plugin.enable_plugin(cluster_id, self.fuel_web)

        self.show_step(7)
        target_node_1 = self.node_name('slave-05')
        self.fuel_web.vcenter_configure(cluster_id,
                                        target_node_1=target_node_1,
                                        multiclusters=False)

        self.show_step(8)
        self.fuel_web.verify_network(cluster_id)

        self.show_step(9)
        self.fuel_web.deploy_cluster_wait(cluster_id)

        self.show_step(10)
        self.fuel_web.run_ostf(cluster_id=cluster_id, test_sets=['smoke'])

        os_ip = self.fuel_web.get_public_vip(cluster_id)
        self.extended_tests_reset_vcenter(os_ip)

        self.show_step(18)
        self.fuel_web.run_ostf(cluster_id=cluster_id, test_sets=['smoke'])
    def dvs_reboot_vcenter_2(self):
        """Verify that vmclusters should be migrate after reset controller.

        Scenario:
            1. Install DVS plugin on master node.
            2. Create a new environment with following parameters:
                * Compute: KVM/QEMU with vCenter
                * Networking: Neutron with VLAN segmentation
                * Storage: default
                * Additional services: default
            3. Add nodes with following roles:
                * Controller
                * Compute
                * Cinder
                * CinderVMware
                * ComputeVMware
            4. Configure interfaces on nodes.
            5. Configure network settings.
            6. Enable and configure DVS plugin.
            7. Enable VMWare vCenter/ESXi datastore for images (Glance).
            8. Configure VMware vCenter Settings. Add 1 vSphere clusters and
               configure Nova Compute instances on compute-vmware.
            9. Configure Glance credentials on VMware tab.
            10. Verify networks.
            11. Deploy cluster.
            12. Run OSTF.
            13. Launch instance VM_1 with image TestVM, availability zone nova
                and flavor m1.micro.
            14. Launch instance VM_2 with image TestVM-VMDK, availability zone
                vcenter and flavor m1.micro.
            15. Check connection between instances, send ping from VM_1 to VM_2
                and vice verse.
            16. Reboot vcenter.
            17. Check that controller lost connection with vCenter.
            18. Wait for vCenter.
            19. Ensure that all instances from vCenter displayed in dashboard.
            20. Ensure connectivity between instances.
            21. Run OSTF.


        Duration: 2.5 hours

        """
        self.env.revert_snapshot("ready_with_5_slaves")

        plugin.install_dvs_plugin(
            self.env.d_env.get_admin_remote())

        # Configure cluster with 2 vcenter clusters and vcenter glance
        cluster_id = self.fuel_web.create_cluster(
            name=self.__class__.__name__,
            mode=DEPLOYMENT_MODE,
            settings={
                "net_provider": 'neutron',
                "net_segment_type": NEUTRON_SEGMENT_TYPE,
                'images_vcenter': True
            }
        )
        plugin.enable_plugin(cluster_id, self.fuel_web)

        # Assign role to node
        self.fuel_web.update_nodes(
            cluster_id,
            {'slave-01': ['controller'],
             'slave-02': ['compute'],
             'slave-03': ['cinder-vmware'],
             'slave-04': ['cinder'],
             'slave-05': ['compute-vmware']}
        )

        # Configure VMWare vCenter settings
        target_node_1 = self.node_name('slave-05')
        self.fuel_web.vcenter_configure(
            cluster_id,
            target_node_1=target_node_1,
            multiclusters=False,
            vc_glance=True
        )

        self.fuel_web.deploy_cluster_wait(cluster_id)

        self.fuel_web.run_ostf(
            cluster_id=cluster_id, test_sets=['smoke'])

        os_ip = self.fuel_web.get_public_vip(cluster_id)
        self.extended_tests_reset_vcenter(os_ip)
    def dvs_vcenter_net_template(self):
        """Deploy cluster with DVS plugin, Neutron, Ceph and network template.

        Scenario:
            1. Upload plugins to the master node.
            2. Install plugin.
            3. Create cluster with vcenter.
            4. Set CephOSD as backend for Glance and Cinder
            5. Add nodes with following roles:
                controller
                compute-vmware
                compute-vmware
                compute
                3 ceph-osd
            6. Upload network template.
            7. Check network configuration.
            8. Deploy the cluster
            9. Run OSTF

        Duration 2.5 hours

        Duration 180m
        Snapshot deploy_cinder_net_tmpl
        """
        self.env.revert_snapshot("ready_with_9_slaves")

        plugin.install_dvs_plugin(
            self.env.d_env.get_admin_remote())

        cluster_id = self.fuel_web.create_cluster(
            name=self.__class__.__name__,
            mode=DEPLOYMENT_MODE,
            settings={
                "net_provider": 'neutron',
                "net_segment_type": NEUTRON_SEGMENT_TYPE,
                'images_ceph': True,
                'volumes_ceph': True,
                'objects_ceph': True,
                'volumes_lvm': False,
                'tenant': 'netTemplate',
                'user': '******',
                'password': '******',
            }
        )

        plugin.enable_plugin(cluster_id, self.fuel_web)

        self.fuel_web.update_nodes(
            cluster_id,
            {
                'slave-01': ['controller'],
                'slave-02': ['compute-vmware'],
                'slave-03': ['compute-vmware'],
                'slave-04': ['compute'],
                'slave-05': ['ceph-osd'],
                'slave-06': ['ceph-osd'],
                'slave-07': ['ceph-osd'],
            },
            update_interfaces=False
        )

        # Configure VMWare vCenter settings
        target_node_1 = self.node_name('slave-02')
        target_node_2 = self.node_name('slave-03')
        self.fuel_web.vcenter_configure(
            cluster_id,
            target_node_1=target_node_1,
            target_node_2=target_node_2,
            multiclusters=True
        )

        network_template = self.get_network_template('default')
        self.fuel_web.client.upload_network_template(
            cluster_id=cluster_id, network_template=network_template)
        networks = self.generate_networks_for_template(
            template=network_template,
            ip_nets={'default': '10.200.0.0/16'},
            ip_prefixlen='24')
        existing_networks = self.fuel_web.client.get_network_groups()
        networks = self.create_custom_networks(networks, existing_networks)

        logger.debug('Networks: {0}'.format(
            self.fuel_web.client.get_network_groups()))

        self.fuel_web.verify_network(cluster_id)

        self.fuel_web.deploy_cluster_wait(cluster_id, timeout=180 * 60)

        self.fuel_web.verify_network(cluster_id)

        self.check_ipconfig_for_template(cluster_id, network_template,
                                         networks)
        self.check_services_networks(cluster_id, network_template)

        self.fuel_web.run_ostf(cluster_id=cluster_id,
                               test_sets=['smoke', 'sanity',
                                          'ha', 'tests_platform'])
        self.check_ipconfig_for_template(cluster_id, network_template,
                                         networks)

        self.check_services_networks(cluster_id, network_template)
    def dvs_destructive_setup_2(self):
        """Verify that vmclusters should be migrate after reset controller.

        Scenario:
            1. Upload plugins to the master node
            2. Install plugin.
            3. Create cluster with vcenter.
            4. Add 3 node with controller role.
            5. Add 2 node with compute role.
            6. Deploy the cluster.
            7. Launch instances.

        Duration: 1.8 hours

        """
        self.env.revert_snapshot("ready_with_5_slaves")

        plugin.install_dvs_plugin(
            self.env.d_env.get_admin_remote())

        # Configure cluster with 2 vcenter clusters and vcenter glance
        cluster_id = self.fuel_web.create_cluster(
            name=self.__class__.__name__,
            mode=DEPLOYMENT_MODE,
            settings={
                "net_provider": 'neutron',
                "net_segment_type": NEUTRON_SEGMENT_TYPE
            }
        )
        plugin.enable_plugin(cluster_id, self.fuel_web)

        # Assign role to node
        self.fuel_web.update_nodes(
            cluster_id,
            {'slave-01': ['controller'],
             'slave-02': ['controller'],
             'slave-03': ['controller'],
             'slave-04': ['compute'],
             'slave-05': ['compute']}
        )
        # Configure VMWare vCenter settings
        self.fuel_web.vcenter_configure(cluster_id, multiclusters=True)

        self.fuel_web.deploy_cluster_wait(cluster_id)

        self.fuel_web.run_ostf(
            cluster_id=cluster_id, test_sets=['smoke'])

        os_ip = self.fuel_web.get_public_vip(cluster_id)
        os_conn = os_actions.OpenStackActions(
            os_ip, SERVTEST_USERNAME,
            SERVTEST_PASSWORD,
            SERVTEST_TENANT)

        # create security group with rules for ssh and ping
        security_group = os_conn.create_sec_group_for_ssh()

        network = os_conn.nova.networks.find(label=self.inter_net_name)
        instances = openstack.create_instances(
            os_conn=os_conn, nics=[{'net-id': network.id}], vm_count=1,
            security_groups=[security_group.name]
        )
        openstack.verify_instance_state(os_conn)

        for instance in instances:
            os_conn.assign_floating_ip(instance)

        self.env.make_snapshot("dvs_destructive_setup_2", is_make=True)
Exemple #13
0
    def dvs_reboot_vcenter_2(self):
        """Verify that vmclusters migrate after reset controller.

        Scenario:
            1. Install DVS plugin on master node.
            2. Create a new environment with following parameters:
                * Compute: KVM/QEMU with vCenter
                * Networking: Neutron with VLAN segmentation
                * Storage: default
                * Additional services: default
            3. Add nodes with following roles:
                * Controller
                * Compute
                * Cinder
                * CinderVMware
                * ComputeVMware
            4. Configure interfaces on nodes.
            5. Configure network settings.
            6. Enable and configure DVS plugin.
            7. Configure VMware vCenter Settings. Add 1 vSphere clusters and
               configure Nova Compute instances on compute-vmware.
            8. Verify networks.
            9. Deploy cluster.
            10. Run Smoke OSTF.
            11. Launch instance VM_1 with image TestVM, availability zone nova
                and flavor m1.micro.
            12. Launch instance VM_2 with image TestVM-VMDK, availability zone
                vcenter and flavor m1.micro.
            13. Verify connection between instances: check that VM_1 to VM_2
                can ping each other.
            14. Reboot vcenter.
            15. Check that controller lost connection with vCenter.
            16. Wait for vCenter.
            17. Ensure that all instances from vCenter displayed in dashboard.
            18. Run Smoke OSTF.

        Duration: 2.5 hours

        """
        self.env.revert_snapshot("ready_with_5_slaves")

        self.show_step(1)
        plugin.install_dvs_plugin(self.ssh_manager.admin_ip)

        self.show_step(2)
        cluster_id = self.fuel_web.create_cluster(name=self.__class__.__name__,
                                                  mode=DEPLOYMENT_MODE,
                                                  settings={
                                                      "net_provider":
                                                      'neutron',
                                                      "net_segment_type":
                                                      NEUTRON_SEGMENT_TYPE
                                                  })

        self.show_step(3)
        self.show_step(4)
        self.show_step(5)
        self.fuel_web.update_nodes(
            cluster_id, {
                'slave-01': ['controller'],
                'slave-02': ['compute'],
                'slave-03': ['cinder-vmware'],
                'slave-04': ['cinder'],
                'slave-05': ['compute-vmware']
            })

        self.show_step(6)
        plugin.enable_plugin(cluster_id, self.fuel_web)

        self.show_step(7)
        target_node_1 = self.node_name('slave-05')
        self.fuel_web.vcenter_configure(cluster_id,
                                        target_node_1=target_node_1,
                                        multiclusters=False)

        self.show_step(8)
        self.fuel_web.verify_network(cluster_id)

        self.show_step(9)
        self.fuel_web.deploy_cluster_wait(cluster_id)

        self.show_step(10)
        self.fuel_web.run_ostf(cluster_id=cluster_id, test_sets=['smoke'])

        os_ip = self.fuel_web.get_public_vip(cluster_id)
        self.extended_tests_reset_vcenter(os_ip)

        self.show_step(18)
        self.fuel_web.run_ostf(cluster_id=cluster_id, test_sets=['smoke'])
Exemple #14
0
    def dvs_destructive_setup_2(self):
        """Verify that vmclusters migrate after reset controller.

        Scenario:
            1. Upload plugins to the master node.
            2. Install plugin.
            3. Configure cluster with 2 vcenter clusters.
            4. Add 3 node with controller role.
            5. Add 2 node with compute role.
            6. Configure vcenter.
            7. Deploy the cluster.
            8. Run smoke OSTF tests
            9. Launch instances. 1 per az. Assign floating ips.
            10. Make snapshot.

        Duration: 1.8 hours
        Snapshot: dvs_destructive_setup_2
        """
        self.show_step(1)
        self.env.revert_snapshot("ready_with_5_slaves")

        plugin.install_dvs_plugin(self.ssh_manager.admin_ip)

        self.show_step(2)
        cluster_id = self.fuel_web.create_cluster(name=self.__class__.__name__,
                                                  mode=DEPLOYMENT_MODE,
                                                  settings={
                                                      "net_provider":
                                                      'neutron',
                                                      "net_segment_type":
                                                      NEUTRON_SEGMENT_TYPE
                                                  })
        plugin.enable_plugin(cluster_id, self.fuel_web)

        self.show_step(3)
        self.show_step(4)
        self.fuel_web.update_nodes(
            cluster_id, {
                'slave-01': ['controller'],
                'slave-02': ['controller'],
                'slave-03': ['controller'],
                'slave-04': ['compute'],
                'slave-05': ['compute']
            })
        self.show_step(6)
        self.fuel_web.vcenter_configure(cluster_id, multiclusters=True)

        self.show_step(7)
        self.fuel_web.deploy_cluster_wait(cluster_id)

        self.show_step(8)
        self.fuel_web.run_ostf(cluster_id=cluster_id, test_sets=['smoke'])

        self.show_step(9)
        os_ip = self.fuel_web.get_public_vip(cluster_id)
        os_conn = os_actions.OpenStackActions(os_ip, SERVTEST_USERNAME,
                                              SERVTEST_PASSWORD,
                                              SERVTEST_TENANT)

        security_group = os_conn.create_sec_group_for_ssh()

        network = os_conn.nova.networks.find(label=self.inter_net_name)
        instances = openstack.create_instances(
            os_conn=os_conn,
            nics=[{
                'net-id': network.id
            }],
            vm_count=1,
            security_groups=[security_group.name])
        openstack.verify_instance_state(os_conn)
        openstack.create_and_assign_floating_ips(os_conn, instances)

        self.show_step(10)
        self.env.make_snapshot("dvs_destructive_setup_2", is_make=True)
    def dvs_reboot_vcenter_2(self):
        """Verify that vmclusters should be migrate after reset controller.

        Scenario:
            1. Install DVS plugin on master node.
            2. Create a new environment with following parameters:
                * Compute: KVM/QEMU with vCenter
                * Networking: Neutron with VLAN segmentation
                * Storage: default
                * Additional services: default
            3. Add nodes with following roles:
                * Controller
                * Compute
                * Cinder
                * CinderVMware
                * ComputeVMware
            4. Configure interfaces on nodes.
            5. Configure network settings.
            6. Enable and configure DVS plugin.
            7. Enable VMWare vCenter/ESXi datastore for images (Glance).
            8. Configure VMware vCenter Settings. Add 1 vSphere clusters and
               configure Nova Compute instances on compute-vmware.
            9. Configure Glance credentials on VMware tab.
            10. Verify networks.
            11. Deploy cluster.
            12. Run OSTF.
            13. Launch instance VM_1 with image TestVM, availability zone nova
                and flavor m1.micro.
            14. Launch instance VM_2 with image TestVM-VMDK, availability zone
                vcenter and flavor m1.micro.
            15. Check connection between instances, send ping from VM_1 to VM_2
                and vice verse.
            16. Reboot vcenter.
            17. Check that controller lost connection with vCenter.
            18. Wait for vCenter.
            19. Ensure that all instances from vCenter displayed in dashboard.
            20. Ensure connectivity between instances.
            21. Run OSTF.


        Duration: 2.5 hours

        """
        self.env.revert_snapshot("ready_with_5_slaves")

        plugin.install_dvs_plugin(self.env.d_env.get_admin_remote())

        # Configure cluster with 2 vcenter clusters and vcenter glance
        cluster_id = self.fuel_web.create_cluster(name=self.__class__.__name__,
                                                  mode=DEPLOYMENT_MODE,
                                                  settings={
                                                      "net_provider":
                                                      'neutron',
                                                      "net_segment_type":
                                                      NEUTRON_SEGMENT_TYPE,
                                                      'images_vcenter': True
                                                  })
        plugin.enable_plugin(cluster_id, self.fuel_web)

        # Assign role to node
        self.fuel_web.update_nodes(
            cluster_id, {
                'slave-01': ['controller'],
                'slave-02': ['compute'],
                'slave-03': ['cinder-vmware'],
                'slave-04': ['cinder'],
                'slave-05': ['compute-vmware']
            })

        # Configure VMWare vCenter settings
        target_node_1 = self.node_name('slave-05')
        self.fuel_web.vcenter_configure(cluster_id,
                                        target_node_1=target_node_1,
                                        multiclusters=False,
                                        vc_glance=True)

        self.fuel_web.deploy_cluster_wait(cluster_id)

        self.fuel_web.run_ostf(cluster_id=cluster_id, test_sets=['smoke'])

        os_ip = self.fuel_web.get_public_vip(cluster_id)
        self.extended_tests_reset_vcenter(os_ip)
    def dvs_destructive_setup_2(self):
        """Verify that vmclusters should be migrate after reset controller.

        Scenario:
            1. Upload plugins to the master node
            2. Install plugin.
            3. Create cluster with vcenter.
            4. Add 3 node with controller role.
            5. Add 2 node with compute role.
            6. Deploy the cluster.
            7. Launch instances.

        Duration: 1.8 hours

        """
        self.env.revert_snapshot("ready_with_5_slaves")

        plugin.install_dvs_plugin(self.env.d_env.get_admin_remote())

        # Configure cluster with 2 vcenter clusters and vcenter glance
        cluster_id = self.fuel_web.create_cluster(name=self.__class__.__name__,
                                                  mode=DEPLOYMENT_MODE,
                                                  settings={
                                                      "net_provider":
                                                      'neutron',
                                                      "net_segment_type":
                                                      NEUTRON_SEGMENT_TYPE
                                                  })
        plugin.enable_plugin(cluster_id, self.fuel_web)

        # Assign role to node
        self.fuel_web.update_nodes(
            cluster_id, {
                'slave-01': ['controller'],
                'slave-02': ['controller'],
                'slave-03': ['controller'],
                'slave-04': ['compute'],
                'slave-05': ['compute']
            })
        # Configure VMWare vCenter settings
        self.fuel_web.vcenter_configure(cluster_id, multiclusters=True)

        self.fuel_web.deploy_cluster_wait(cluster_id)

        self.fuel_web.run_ostf(cluster_id=cluster_id, test_sets=['smoke'])

        os_ip = self.fuel_web.get_public_vip(cluster_id)
        os_conn = os_actions.OpenStackActions(os_ip, SERVTEST_USERNAME,
                                              SERVTEST_PASSWORD,
                                              SERVTEST_TENANT)

        # create security group with rules for ssh and ping
        security_group = os_conn.create_sec_group_for_ssh()

        network = os_conn.nova.networks.find(label=self.inter_net_name)
        instances = openstack.create_instances(
            os_conn=os_conn,
            nics=[{
                'net-id': network.id
            }],
            vm_count=1,
            security_groups=[security_group.name])
        openstack.verify_instance_state(os_conn)

        for instance in instances:
            os_conn.assign_floating_ip(instance)

        self.env.make_snapshot("dvs_destructive_setup_2", is_make=True)