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')
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
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
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
def f(): vms = [rec['uuid'] for ref, rec in fake.get_all_records('VM').iteritems() if rec['is_control_domain']] return vms[0]
def f(): vms = [ rec['uuid'] for ref, rec in fake.get_all_records('VM').iteritems() if rec['is_control_domain'] ] return vms[0]
def f(session): vms = [rec['uuid'] for rec in fake.get_all_records('VM').values() if rec['is_control_domain']] return vms[0]
def f(): vms = [rec["uuid"] for ref, rec in fake.get_all_records("VM").iteritems() if rec["is_control_domain"]] return vms[0]
def f(session): vms = [ rec['uuid'] for rec in fake.get_all_records('VM').values() if rec['is_control_domain'] ] return vms[0]