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 _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")
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 _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_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 _check_xen_sr(self, xen_sr_name, should_exist=True): sf_util.check_xen_sr(xen_sr_name, self.xen_session, self, should_exist)