def start_vm(workflow_dict):
    try:
        environment = workflow_dict['environment']
        cs_credentials = get_credentials_for(
            environment=environment, credential_type=CredentialType.CLOUDSTACK)
        cs_provider = CloudStackProvider(credentials=cs_credentials)

        host = workflow_dict['host']
        host_csattr = HostAttr.objects.get(host=host)
        started = cs_provider.start_virtual_machine(vm_id=host_csattr.vm_id)
        if not started:
            raise Exception("Could not start host {}".format(host))

        host_ready = check_ssh(server=host.address,
                               username=host_csattr.vm_user,
                               password=host_csattr.vm_password,
                               retries=50,
                               wait=20,
                               interval=30)

        if not host_ready:
            error = "Host %s is not ready..." % host
            LOG.warn(error)
            raise Exception(error)

        return True
    except Exception:
        traceback = full_stack()

        workflow_dict['exceptions']['error_codes'].append(DBAAS_0015)
        workflow_dict['exceptions']['traceback'].append(traceback)

        return False
dataset/ETHPy150Open globocom/database-as-a-service/dbaas/workflow/steps/util/resize/__init__.py/start_vm/original