本文整理汇总了Python中marvin.lib.base.StoragePool.cancelMaintenance方法的典型用法代码示例。如果您正苦于以下问题:Python StoragePool.cancelMaintenance方法的具体用法?Python StoragePool.cancelMaintenance怎么用?Python StoragePool.cancelMaintenance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类marvin.lib.base.StoragePool
的用法示例。
在下文中一共展示了StoragePool.cancelMaintenance方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test06_primary_storage_cancel_maintenance_mode
# 需要导入模块: from marvin.lib.base import StoragePool [as 别名]
# 或者: from marvin.lib.base.StoragePool import cancelMaintenance [as 别名]
def test06_primary_storage_cancel_maintenance_mode(self):
StoragePool.enableMaintenance(self.apiClient,
id=self.primary_storage_id)
StoragePool.cancelMaintenance(self.apiClient,
id=self.primary_storage_id)
# Verify in cloudsatck
storage_pools_response = list_storage_pools(
self.apiClient, clusterid=self.cluster.id)
for storage in storage_pools_response:
if storage.id == self.primary_storage_id:
storage_pool = storage
self.assertEqual(
storage_pool.state, "Up",
"Primary storage not in up mode")
# Verify in datera
datera_primary_storage_name = "cloudstack-" + self.primary_storage_id
for instance in self.datera_api.app_instances.list():
if instance['name'] == datera_primary_storage_name:
datera_instance = instance
self.assertEqual(
datera_instance["admin_state"], "online",
"app-instance not in online mode")
# Verify in xenserver
for key, value in self.xen_session.xenapi.SR.get_all_records().items():
if value['name_description'] == self.primary_storage_id:
xen_sr = value
self.assertEqual(
set(["forget", "destroy"]).issubset(xen_sr["allowed_operations"]),
False, "Xenserver SR in offline mode")
StoragePool.delete(self.primary_storage, self.apiClient)
self.cleanup = []
示例2: tearDown
# 需要导入模块: from marvin.lib.base import StoragePool [as 别名]
# 或者: from marvin.lib.base.StoragePool import cancelMaintenance [as 别名]
def tearDown(self):
# Clean up, terminate the created resources
StoragePool.cancelMaintenance(self.api_client,
id=self.storageid[0][0])
cleanup_resources(self.apiClient, self.cleanup)
return
示例3: test_01_create_system_vms_on_managed_storage
# 需要导入模块: from marvin.lib.base import StoragePool [as 别名]
# 或者: from marvin.lib.base.StoragePool import cancelMaintenance [as 别名]
def test_01_create_system_vms_on_managed_storage(self):
self._disable_zone_and_delete_system_vms(None, False)
primary_storage = self.testdata[TestData.primaryStorage]
primary_storage_1 = StoragePool.create(
self.apiClient,
primary_storage
)
self._prepare_to_use_managed_storage_for_system_vms()
enabled = "Enabled"
self.zone.update(self.apiClient, id=self.zone.id, allocationstate=enabled)
system_vms = self._wait_for_and_get_running_system_vms(2)
virtual_machine = VirtualMachine.create(
self.apiClient,
self.testdata[TestData.virtualMachine],
accountid=self.account.name,
zoneid=self.zone.id,
serviceofferingid=self.compute_offering.id,
templateid=self.template.id,
domainid=self.domain.id,
startvm=True
)
# This virtual machine was only created and started so that the virtual router would be created and started.
# Just delete this virtual machine once it has been created and started.
virtual_machine.delete(self.apiClient, True)
virtual_router = list_routers(self.apiClient, listall=True, state="Running")[0]
system_vms.append(virtual_router)
self._check_system_vms(system_vms, primary_storage_1.id)
primary_storage[TestData.name] = TestData.get_name_for_solidfire_storage()
primary_storage_2 = StoragePool.create(
self.apiClient,
primary_storage
)
StoragePool.enableMaintenance(self.apiClient, primary_storage_1.id)
self._wait_for_storage_cleanup_thread(system_vms)
sf_util.purge_solidfire_volumes(self.sfe)
system_vms = self._wait_for_and_get_running_system_vms(2)
virtual_router = list_routers(self.apiClient, listall=True, state="Running")[0]
system_vms.append(virtual_router)
self._check_system_vms(system_vms, primary_storage_2.id)
StoragePool.cancelMaintenance(self.apiClient, primary_storage_1.id)
primary_storage_1.delete(self.apiClient)
self._disable_zone_and_delete_system_vms(virtual_router)
self._wait_for_storage_cleanup_thread(system_vms)
sf_util.purge_solidfire_volumes(self.sfe)
primary_storage_2.delete(self.apiClient)
self._verify_no_active_solidfire_volumes()
self._prepare_to_stop_using_managed_storage_for_system_vms()
self.zone.update(self.apiClient, id=self.zone.id, allocationstate=enabled)
self._wait_for_and_get_running_system_vms(2)