def do_ovirt_stop(prefix, **kwargs): with LogTask('Stopping oVirt environment'): with LogTask('Stopping Engine VMs'): prefix.virt_env.engine_vm().stop_all_vms() with LogTask('Putting hosts in maintenance mode'): prefix.virt_env.engine_vm().stop_all_hosts() with LogTask('Shutdown Lago VMs'): prefix.shutdown()
def do_ovirt_start(prefix, with_vms, **kwargs): with LogTask('Starting oVirt environment'): prefix.start() with LogTask('Activating Engine Hosts'): prefix.virt_env.engine_vm().start_all_hosts() if with_vms: with LogTask('Waiting for Storage domains to be in active mode'): prefix.virt_env.engine_vm().check_sds_status() with LogTask('Starting Engine VMs'): prefix.virt_env.engine_vm().start_all_vms()
def do_ovirt_start(prefix, with_vms, vms_timeout, **kwargs): with LogTask('Starting oVirt environment'): prefix.start() with LogTask('Waiting for ovirt-engine status'): prefix.virt_env.assert_engine_alive(timeout=3 * 60) with LogTask('Waiting for vdsmd status'): prefix.virt_env.assert_vdsm_alive(timeout=3 * 60) with LogTask('Updating Clusters CPU'): prefix.virt_env.update_clusters_cpu() with LogTask('Activating Engine Hosts'): prefix.virt_env.engine_vm().start_all_hosts(timeout=5 * 60) if with_vms: with LogTask('Waiting for Storage domains to be in active mode'): prefix.virt_env.engine_vm().check_sds_status(timeout=5 * 60) with LogTask('Starting Engine VMs'): prefix.virt_env.engine_vm().start_all_vms(timeout=vms_timeout) LOGGER.info( textwrap.dedent(""" The environment is ready to be used. You can access the web UI with the following link and credentials: https://{ip} Username: {username} Password: {password} """.format(ip=prefix.virt_env.engine_vm().ip(), username=constants.ENGINE_USER.split('@')[0], password=prefix.virt_env.engine_vm(). metadata['ovirt-engine-password'])))
def do_ovirt_start(prefix, **kwargs): with LogTask('Starting oVirt environment'): prefix.start() with LogTask('Activating Engine Hosts'): prefix.virt_env.engine_vm().start_all_hosts()
def catcher(self, logger): with LogTask('I should catch the exception', logger=logger): try: raise RuntimeError() except RuntimeError: pass
def thrower(self, logger): with LogTask('I should throw the exception', logger=logger): raise RuntimeError()