Exemplo n.º 1
0
    def check_vm_record(self, conn):
        instances = conn.list_instances()
        self.assertEquals(instances, [1])

        # Get Nova record for VM
        vm_info = conn.get_info(1)

        # Get XenAPI record for VM
        vms = [rec for ref, rec
               in xenapi_fake.get_all_records('VM').iteritems()
               if not rec['is_control_domain']]
        vm = vms[0]

        # Check that m1.large above turned into the right thing.
        instance_type = db.instance_type_get_by_name(conn, 'm1.large')
        mem_kib = long(instance_type['memory_mb']) << 10
        mem_bytes = str(mem_kib << 10)
        vcpus = instance_type['vcpus']
        self.assertEquals(vm_info['max_mem'], mem_kib)
        self.assertEquals(vm_info['mem'], mem_kib)
        self.assertEquals(vm['memory_static_max'], mem_bytes)
        self.assertEquals(vm['memory_dynamic_max'], mem_bytes)
        self.assertEquals(vm['memory_dynamic_min'], mem_bytes)
        self.assertEquals(vm['VCPUs_max'], str(vcpus))
        self.assertEquals(vm['VCPUs_at_startup'], str(vcpus))

        # Check that the VM is running according to Nova
        self.assertEquals(vm_info['state'], power_state.RUNNING)

        # Check that the VM is running according to XenAPI.
        self.assertEquals(vm['power_state'], 'Running')
Exemplo n.º 2
0
    def create_vm_record(self, conn, os_type, instance_id=1):
        instances = conn.list_instances()
        self.assertEquals(instances, [str(instance_id)])

        # Get Nova record for VM
        vm_info = conn.get_info(instance_id)
        # Get XenAPI record for VM
        vms = [rec for ref, rec in xenapi_fake.get_all_records("VM").iteritems() if not rec["is_control_domain"]]
        vm = vms[0]
        self.vm_info = vm_info
        self.vm = vm
Exemplo n.º 3
0
    def create_vm_record(self, conn, os_type, instance_id=1):
        instances = conn.list_instances()
        self.assertEquals(instances, [str(instance_id)])

        # Get Nova record for VM
        vm_info = conn.get_info(instance_id)
        # Get XenAPI record for VM
        vms = [rec for ref, rec
               in xenapi_fake.get_all_records('VM').iteritems()
               if not rec['is_control_domain']]
        vm = vms[0]
        self.vm_info = vm_info
        self.vm = vm
Exemplo n.º 4
0
    def create_vm_record(self, conn, os_type):
        instances = conn.list_instances()
        self.assertEquals(instances, [1])

        # Get Nova record for VM
        vm_info = conn.get_info(1)

        # Get XenAPI record for VM
        vms = [rec for ref, rec
               in xenapi_fake.get_all_records('VM').iteritems()
               if not rec['is_control_domain']]
        vm = vms[0]
        self.vm_info = vm_info
        self.vm = vm
Exemplo n.º 5
0
 def f():
     vms = [rec['uuid'] for ref, rec
            in fake.get_all_records('VM').iteritems()
            if rec['is_control_domain']]
     return vms[0]
Exemplo n.º 6
0
Arquivo: stubs.py Projeto: termie/nova
 def f():
     vms = [
         rec['uuid'] for ref, rec in fake.get_all_records('VM').iteritems()
         if rec['is_control_domain']
     ]
     return vms[0]
Exemplo n.º 7
0
 def f(session):
     vms = [rec['uuid'] for rec
            in fake.get_all_records('VM').values()
            if rec['is_control_domain']]
     return vms[0]
Exemplo n.º 8
0
 def f():
     vms = [rec["uuid"] for ref, rec in fake.get_all_records("VM").iteritems() if rec["is_control_domain"]]
     return vms[0]
Exemplo n.º 9
0
 def f(session):
     vms = [
         rec['uuid'] for rec in fake.get_all_records('VM').values()
         if rec['is_control_domain']
     ]
     return vms[0]