示例#1
0
 def guest_start(self, userid, timeout=0):
     """"Power on z/VM instance."""
     LOG.info("Begin to power on vm %s", userid)
     self._smtclient.guest_start(userid)
     if timeout > 0:
         self.wait_for_reachable(userid, timeout)
         if not self.is_reachable(userid):
             msg = "guest does not reachable"
             raise exception.SDKGuestOperationError(rs=16, userid=userid,
                                                    msg=msg)
     LOG.info("Complete power on vm %s", userid)
示例#2
0
 def guest_start(self, userid, timeout=0):
     """"Power on z/VM instance."""
     LOG.info("Begin to power on vm %s", userid)
     self._smtclient.guest_start(userid)
     if timeout > 0:
         self.wait_for_reachable(userid, timeout)
         if not self.is_reachable(userid):
             msg = ("compute node is not able to connect to the virtual "
                    "machine in %d seconds" % timeout)
             raise exception.SDKGuestOperationError(rs=16, userid=userid,
                                                    msg=msg)
     LOG.info("Complete power on vm %s", userid)
示例#3
0
def get_fcp_conn():
    global _FCP_CONN, _DBLOCK_FCP
    if not _FCP_CONN:
        _FCP_CONN = _init_db_conn(const.DATABASE_FCP)

    _DBLOCK_FCP.acquire()
    try:
        yield _FCP_CONN
    except Exception as err:
        msg = "Execute SQL statements error: %s" % six.text_type(err)
        LOG.error(msg)
        raise exception.SDKGuestOperationError(rs=1, msg=msg)
    finally:
        _DBLOCK_FCP.release()