示例#1
0
 def move_away(storagerouter_guid):
     """
     Moves away all vDisks from all Storage Drivers this Storage Router is serving
     """
     storagedrivers = StorageRouter(storagerouter_guid).storagedrivers
     if len(storagedrivers) > 0:
         storagedriver_client = StorageDriverClient().load(storagedrivers[0].vpool)
         for storagedriver in storagedrivers:
             storagedriver_client.mark_node_offline(str(storagedriver.storagedriver_id))
示例#2
0
 def move_away(storagerouter_guid):
     """
     Moves away all vDisks from all Storage Drivers this Storage Router is serving
     """
     storagedrivers = StorageRouter(storagerouter_guid).storagedrivers
     if len(storagedrivers) > 0:
         storagedriver_client = StorageDriverClient().load(
             storagedrivers[0].vpool)
         for storagedriver in storagedrivers:
             storagedriver_client.mark_node_offline(
                 str(storagedriver.storagedriver_id))
示例#3
0
 def update_status(storagedriver_id):
     """
     Sets Storage Driver offline in case hypervisor management Center
     reports the hypervisor pmachine related to this Storage Driver
     as unavailable.
     """
     pmachine = PMachineList.get_by_storagedriver_id(storagedriver_id)
     if pmachine.mgmtcenter:
         # Update status
         pmachine.invalidate_dynamics(['host_status'])
         host_status = pmachine.host_status
         if host_status != 'RUNNING':
             # Host is stopped
             storagedriver = StorageDriverList.get_by_storagedriver_id(storagedriver_id)
             storagedriver_client = StorageDriverClient().load(storagedriver.vpool)
             storagedriver_client.mark_node_offline(str(storagedriver.storagedriver_id))
     else:
         # No management Center, cannot update status via api
         #TODO: should we try manually (ping, ssh)?
         pass
示例#4
0
 def update_status(storagedriver_id):
     """
     Sets Storage Driver offline in case hypervisor management Center
     reports the hypervisor pmachine related to this Storage Driver
     as unavailable.
     """
     pmachine = PMachineList.get_by_storagedriver_id(storagedriver_id)
     if pmachine.mgmtcenter:
         # Update status
         pmachine.invalidate_dynamics(['host_status'])
         host_status = pmachine.host_status
         if host_status != 'RUNNING':
             # Host is stopped
             storagedriver = StorageDriverList.get_by_storagedriver_id(
                 storagedriver_id)
             storagedriver_client = StorageDriverClient().load(
                 storagedriver.vpool)
             storagedriver_client.mark_node_offline(
                 str(storagedriver.storagedriver_id))
     else:
         # No management Center, cannot update status via api
         #TODO: should we try manually (ping, ssh)?
         pass