if status == STORAGE_POOL_START:
storagepool_start_stop_job(self, model, pools_obj[0], 'start')
elif status == STORAGE_POOL_STOP:
- storagepool_start_stop_job(self, model, pools_obj[0], 'stop')
+ if kvc.is_used_storage_pool(name=pools_obj[0].get_storage_name(),
+ active_only=True) is True:
+ self.logger.debug("Stop storage pool failed. Target storage pool is used by guest.")
+ return web.badrequest("Target storage pool is used by guest.")
+ else:
+ storagepool_start_stop_job(self, model, pools_obj[0], 'stop')
else:
self.logger.debug("Set storage pool status failed. Unknown status type.")
return web.badrequest()