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))
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))
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
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