def _detachStorageDomain(self, sdUUID, newMasterSdUUID): self._log.info('detachStorageDomain') spUUID = self._spUUID master_ver = 1 with self._server_error_to_runtime_error(): self._cli.StorageDomain.detach( storagedomainID=sdUUID, storagepoolID=spUUID, masterSdUUID=newMasterSdUUID, masterVersion=master_ver ) heconflib.task_wait(self._cli, self._log) if self._log.isEnabledFor(logging.DEBUG): try: self._log.debug( self._cli.StoragePool.getSpmStatus(storagepoolID=spUUID) ) self._log.debug( self._cli.StoragePool.getInfo(storagepoolID=spUUID) ) self._log.debug( self._cli.Host.getStorageRepoStats(domains=[sdUUID]) ) except ServerError as e: self._log.debug( "Error when getting info for debug log: %s", e )
def _detachStorageDomain(self, sdUUID, newMasterSdUUID): self._log.info('detachStorageDomain') spUUID = self._spUUID master_ver = 1 with self._server_error_to_runtime_error(): self._cli.StorageDomain.detach( storagedomainID=sdUUID, storagepoolID=spUUID, masterSdUUID=newMasterSdUUID, masterVersion=master_ver ) heconflib.task_wait(self._cli, self._log) if self._log.isEnabledFor(logging.DEBUG): try: self._log.debug( self._cli.StoragePool.getSpmStatus(storagepoolID=spUUID) ) self._log.debug( self._cli.StoragePool.getInfo(storagepoolID=spUUID) ) self._log.debug( self._cli.Host.getStorageRepoStats(domains=[sdUUID]) ) except ServerError as e: self._log.debug( "Error when getting info for debug log: %s", e )
def _detachStorageDomain(self, sdUUID, newMasterSdUUID): self.logger.debug('detachStorageDomain') spUUID = self.environment[ohostedcons.StorageEnv.SP_UUID] master_ver = 1 try: self.cli.StorageDomain.detach( storagedomainID=sdUUID, storagepoolID=spUUID, masterSdUUID=newMasterSdUUID, masterVersion=master_ver ) except ServerError as e: raise RuntimeError(str(e)) heconflib.task_wait(self.cli, self.logger) try: self.logger.debug(self.cli.StoragePool.getSpmStatus( storagepoolID=spUUID )) self.logger.debug(self.cli.StoragePool.getInfo( storagepoolID=spUUID )) self.logger.debug(self.cli.Host.getStorageRepoStats()) except ServerError as e: self.logger.debug(str(e))
def _activateStorageDomain(self, sdUUID): self.logger.debug('activateStorageDomain') spUUID = self.environment[ohostedcons.StorageEnv.SP_UUID] status = self.cli.activateStorageDomain(sdUUID, spUUID) if status['status']['code'] != 0: raise RuntimeError(status['status']['message']) heconflib.task_wait(self.cli, self.logger) self.logger.debug(self.cli.getSpmStatus(spUUID)) info = self.cli.getStoragePoolInfo(spUUID) self.logger.debug(info) self.logger.debug(self.cli.repoStats())
def _activateStorageDomain(self, sdUUID): self.logger.debug('activateStorageDomain') spUUID = self.environment[ohostedcons.StorageEnv.SP_UUID] status = self.cli.activateStorageDomain( sdUUID, spUUID ) if status['status']['code'] != 0: raise RuntimeError(status['status']['message']) heconflib.task_wait(self.cli, self.logger) self.logger.debug(self.cli.getSpmStatus(spUUID)) info = self.cli.getStoragePoolInfo(spUUID) self.logger.debug(info) self.logger.debug(self.cli.repoStats())
def _detachStorageDomain(self, sdUUID, newMasterSdUUID): self._log.info('detachStorageDomain') spUUID = self._spUUID master_ver = 1 status = self._cli.detachStorageDomain( storagedomainID=sdUUID, storagepoolID=spUUID, masterSdUUID=newMasterSdUUID, masterVersion=master_ver ) if status['status']['code'] != 0: raise RuntimeError(status['status']['message']) heconflib.task_wait(self._cli, self._log) self._log.debug(self._cli.getSpmStatus(spUUID)) info = self._cli.getStoragePoolInfo(spUUID) self._log.debug(info) self._log.debug(self._cli.repoStats())
def _activateStorageDomain(self, sdUUID): self.logger.debug('activateStorageDomain') spUUID = self.environment[ohostedcons.StorageEnv.SP_UUID] try: self.cli.StorageDomain.activate(storagedomainID=sdUUID, storagepoolID=spUUID) except ServerError as e: raise RuntimeError(str(e)) heconflib.task_wait(self.cli, self.logger) try: self.logger.debug( self.cli.StoragePool.getSpmStatus(storagepoolID=spUUID)) self.logger.debug( self.cli.StoragePool.getInfo(storagepoolID=spUUID)) self.logger.debug(self.cli.Host.getStorageRepoStats()) except ServerError as e: self.logger.debug(str(e))