Example #1
0
 def setUp(self):
     super(GetConsoleOutputTestCase, self).setUp()
     stubs.stubout_session(self.stubs, xenapi_fake.SessionBase)
     self._session = xenapi_conn.XenAPISession('test_url', 'root',
                                               'test_pass',
                                               fake.FakeVirtAPI())
     self.vmops = vmops.VMOps(self._session, fake.FakeVirtAPI())
     self.vms = []
Example #2
0
 def __init__(self, url, user, pw):
     super(XenAPIConnection, self).__init__()
     self._session = XenAPISession(url, user, pw)
     self._volumeops = volumeops.VolumeOps(self._session)
     self._host_state = None
     self._host = host.Host(self._session)
     self._vmops = vmops.VMOps(self._session)
     self._initiator = None
     self._pool = pool.ResourcePool(self._session)
Example #3
0
    def __init__(self, virtapi, read_only=False):
        super(XenAPIDriver, self).__init__(virtapi)

        url = CONF.xenserver.connection_url
        username = CONF.xenserver.connection_username
        password = CONF.xenserver.connection_password
        if not url or password is None:
            raise Exception(_('Must specify connection_url, '
                              'connection_username (optionally), and '
                              'connection_password to use '
                              'compute_driver=xenapi.XenAPIDriver'))

        self._session = session.XenAPISession(url, username, password)
        self._volumeops = volumeops.VolumeOps(self._session)
        self._host_state = None
        self._host = host.Host(self._session, self.virtapi)
        self._vmops = vmops.VMOps(self._session, self.virtapi)
        self._initiator = None
        self._hypervisor_hostname = None
        self._pool = pool.ResourcePool(self._session, self.virtapi)
Example #4
0
    def __init__(self, read_only=False):
        super(XenAPIDriver, self).__init__()

        url = FLAGS.xenapi_connection_url
        username = FLAGS.xenapi_connection_username
        password = FLAGS.xenapi_connection_password
        if not url or password is None:
            raise Exception(
                _('Must specify xenapi_connection_url, '
                  'xenapi_connection_username (optionally), and '
                  'xenapi_connection_password to use '
                  'connection_type=xenapi'))

        self._session = XenAPISession(url, username, password)
        self._volumeops = volumeops.VolumeOps(self._session)
        self._host_state = None
        self._host = host.Host(self._session)
        self._vmops = vmops.VMOps(self._session)
        self._initiator = None
        self._hypervisor_hostname = None
        self._pool = pool.ResourcePool(self._session)
Example #5
0
 def _setup_mock_vmops(self, product_brand=None, product_version=None):
     self._session = self._get_mock_session(product_brand, product_version)
     self._vmops = vmops.VMOps(self._session, fake.FakeVirtAPI())
Example #6
0
 def _setup_mock_vmops(self, product_brand=None, product_version=None):
     stubs.stubout_session(self.stubs, xenapi_fake.SessionBase)
     self._session = xenapi_conn.XenAPISession('test_url', 'root',
                                               'test_pass',
                                               fake.FakeVirtAPI())
     self.vmops = vmops.VMOps(self._session, fake.FakeVirtAPI())