Exemplo n.º 1
1
    def _check_system_vms(self, system_vms, primary_storage_id):
        sf_active_volumes = sf_util.get_active_sf_volumes(self.sfe)

        sf_vag_id = sf_util.get_vag_id(self.cs_api, self.cluster.id, primary_storage_id, self)

        for system_vm in system_vms:
            cs_root_volume = self._get_root_volume_for_system_vm(system_vm.id, 'Ready')
            sf_root_volume = sf_util.check_and_get_sf_volume(sf_active_volumes, cs_root_volume.name, self)

            sf_volume_size = sf_util.get_volume_size_with_hsr(self.cs_api, cs_root_volume, self)

            sf_util.check_size_and_iops(sf_root_volume, cs_root_volume, sf_volume_size, self)

            self._check_iops_against_iops_of_system_offering(cs_root_volume, self.testdata[TestData.systemOffering])

            sf_util.check_vag(sf_root_volume, sf_vag_id, self)

            sr_name = sf_util.format_iqn(sf_root_volume.iqn)

            sf_util.check_xen_sr(sr_name, self.xen_session, self)
    def _verify_xenserver_state(self, xen_session_1, sf_volume_1, xen_session_2, sf_volume_2):
        sr_name = sf_util.format_iqn(sf_volume_1.iqn)

        sf_util.check_xen_sr(sr_name, xen_session_1, self, False)

        sr_name = sf_util.format_iqn(sf_volume_2.iqn)

        sf_util.check_xen_sr(sr_name, xen_session_2, self)
    def _verify_xenserver_state(self, xen_session_1, sf_volume_1,
                                xen_session_2, sf_volume_2):
        sr_name = sf_util.format_iqn(sf_volume_1.iqn)

        sf_util.check_xen_sr(sr_name, xen_session_1, self, False)

        sr_name = sf_util.format_iqn(sf_volume_2.iqn)

        sf_util.check_xen_sr(sr_name, xen_session_2, self)
Exemplo n.º 4
0
    def _check_system_vms(self, system_vms, primary_storage_id):
        sf_active_volumes = sf_util.get_active_sf_volumes(self.sfe)

        sf_vag_id = sf_util.get_vag_id(self.cs_api, self.cluster.id, primary_storage_id, self)

        for system_vm in system_vms:
            cs_root_volume = self._get_root_volume_for_system_vm(system_vm.id, 'Ready')
            sf_root_volume = sf_util.check_and_get_sf_volume(sf_active_volumes, cs_root_volume.name, self)

            sf_volume_size = sf_util.get_volume_size_with_hsr(self.cs_api, cs_root_volume, self)

            sf_util.check_size_and_iops(sf_root_volume, cs_root_volume, sf_volume_size, self)

            self._check_iops_against_iops_of_system_offering(cs_root_volume, self.testdata[TestData.systemOffering])

            sf_util.check_vag(sf_root_volume, sf_vag_id, self)

            if TestData.hypervisor_type == TestData.xenServer:
                sr_name = sf_util.format_iqn(sf_root_volume.iqn)

                sf_util.check_xen_sr(sr_name, self.xen_session, self)
            elif TestData.hypervisor_type == TestData.kvm:
                list_hosts_response = list_hosts(
                    self.apiClient,
                    type="Routing"
                )

                sf_util.check_kvm_access_to_volume(sf_root_volume.iqn, list_hosts_response, self.testdata[TestData.kvm], self)
            else:
                self.assertTrue(False, "Invalid hypervisor type")
    def _verify_managed_system_vm_deleted(self, cs_root_volume_name):
        sf_not_active_volumes = sf_util.get_not_active_sf_volumes(self.sfe)

        sf_root_volume = sf_util.check_and_get_sf_volume(
            sf_not_active_volumes, cs_root_volume_name, self)

        self.assertEqual(len(sf_root_volume.volume_access_groups), 0,
                         "The volume should not be in a volume access group.")

        if TestData.hypervisor_type == TestData.xenServer:
            sr_name = sf_util.format_iqn(sf_root_volume.iqn)

            sf_util.check_xen_sr(sr_name, self.xen_session, self, False)
        elif TestData.hypervisor_type == TestData.kvm:
            list_hosts_response = list_hosts(self.apiClient, type="Routing")

            kvm_login = self.testdata[TestData.kvm]

            sf_util.check_kvm_access_to_volume(sf_root_volume.iqn,
                                               list_hosts_response,
                                               kvm_login[TestData.username],
                                               kvm_login[TestData.password],
                                               self, False)
        else:
            self.assertTrue(False, "Invalid hypervisor type")
Exemplo n.º 6
0
    def _verify_managed_system_vm_deleted(self, cs_root_volume_name):
        sf_not_active_volumes = sf_util.get_not_active_sf_volumes(self.sfe)

        sf_root_volume = sf_util.check_and_get_sf_volume(sf_not_active_volumes, cs_root_volume_name, self)

        self.assertEqual(
            len(sf_root_volume.volume_access_groups),
            0,
            "The volume should not be in a volume access group."
        )

        if TestData.hypervisor_type == TestData.xenServer:
            sr_name = sf_util.format_iqn(sf_root_volume.iqn)

            sf_util.check_xen_sr(sr_name, self.xen_session, self, False)
        elif TestData.hypervisor_type == TestData.kvm:
            list_hosts_response = list_hosts(
                self.apiClient,
                type="Routing"
            )

            kvm_login = self.testdata[TestData.kvm]

            sf_util.check_kvm_access_to_volume(sf_root_volume.iqn, list_hosts_response, kvm_login[TestData.username], kvm_login[TestData.password], self, False)
        else:
            self.assertTrue(False, "Invalid hypervisor type")
    def _verifyFields(self, cs_volume, sf_volume):
        self.assert_(cs_volume.name == sf_volume.name, "The CloudStack volume name does not match the SolidFire volume name.")

        cs_volume_folder = self._get_cs_volume_folder(cs_volume.id)

        self.assert_(int(cs_volume_folder) == sf_volume.volume_id, "The CloudStack folder name does not match the SolidFire volume ID.")

        cs_volume_iscsi_name = self._get_cs_volume_iscsi_name(cs_volume.id)

        self.assert_(cs_volume_iscsi_name == sf_util.format_iqn(sf_volume.iqn), "The CloudStack volume iscsi_name does not match the SolidFire volume IQN.")
Exemplo n.º 8
0
    def _verify_managed_system_vm_deleted(self, cs_root_volume_name):
        sf_not_active_volumes = sf_util.get_not_active_sf_volumes(self.sfe)

        sf_root_volume = sf_util.check_and_get_sf_volume(sf_not_active_volumes, cs_root_volume_name, self)

        self.assertEqual(
            len(sf_root_volume.volume_access_groups),
            0,
            "The volume should not be in a volume access group."
        )

        sr_name = sf_util.format_iqn(sf_root_volume.iqn)

        sf_util.check_xen_sr(sr_name, self.xen_session, self, False)
    def _verifyFields(self, cs_volume, sf_volume):
        self.assert_(
            cs_volume.name == sf_volume.name,
            "The CloudStack volume name does not match the SolidFire volume name."
        )

        cs_volume_folder = self._get_cs_volume_folder(cs_volume.id)

        self.assert_(
            int(cs_volume_folder) == sf_volume.volume_id,
            "The CloudStack folder name does not match the SolidFire volume ID."
        )

        cs_volume_iscsi_name = self._get_cs_volume_iscsi_name(cs_volume.id)

        self.assert_(
            cs_volume_iscsi_name == sf_util.format_iqn(sf_volume.iqn),
            "The CloudStack volume iscsi_name does not match the SolidFire volume IQN."
        )