From 7e4783516be21c888e83d192f812612f12abc4cf Mon Sep 17 00:00:00 2001 From: Ewan Mellor Date: Sun, 28 Aug 2011 23:40:09 +0530 Subject: [PATCH 1/2] In the XenAPI simulator, set VM.domid, when creating the instance initially, and when starting the VM. This shows up in the logs for Bug #831599, but this fix doesn't actually fix the hang. --- nova/tests/xenapi/stubs.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nova/tests/xenapi/stubs.py b/nova/tests/xenapi/stubs.py index a6a1febd..d309cfb8 100644 --- a/nova/tests/xenapi/stubs.py +++ b/nova/tests/xenapi/stubs.py @@ -18,6 +18,8 @@ import eventlet import json +import random + from nova.virt import xenapi_conn from nova.virt.xenapi import fake from nova.virt.xenapi import volume_utils @@ -191,6 +193,7 @@ class FakeSessionForVMTests(fake.SessionBase): vm['power_state'] = 'Running' vm['is_a_template'] = False vm['is_control_domain'] = False + vm['domid'] = random.randrange(0, 1 << 16) def VM_snapshot(self, session_ref, vm_ref, label): status = "Running" @@ -290,6 +293,7 @@ class FakeSessionForMigrationTests(fake.SessionBase): vm['power_state'] = 'Running' vm['is_a_template'] = False vm['is_control_domain'] = False + vm['domid'] = random.randrange(0, 1 << 16) def stub_out_migration_methods(stubs): From 2fec2cf59f4f8a08b1e6e3ef0362e9a763209052 Mon Sep 17 00:00:00 2001 From: Ewan Mellor Date: Mon, 29 Aug 2011 00:41:14 +0530 Subject: [PATCH 2/2] Start domid's at 1, not 0, to avoid any confusion with dom0. --- nova/tests/xenapi/stubs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nova/tests/xenapi/stubs.py b/nova/tests/xenapi/stubs.py index d309cfb8..647a4c1d 100644 --- a/nova/tests/xenapi/stubs.py +++ b/nova/tests/xenapi/stubs.py @@ -193,7 +193,7 @@ class FakeSessionForVMTests(fake.SessionBase): vm['power_state'] = 'Running' vm['is_a_template'] = False vm['is_control_domain'] = False - vm['domid'] = random.randrange(0, 1 << 16) + vm['domid'] = random.randrange(1, 1 << 16) def VM_snapshot(self, session_ref, vm_ref, label): status = "Running" @@ -293,7 +293,7 @@ class FakeSessionForMigrationTests(fake.SessionBase): vm['power_state'] = 'Running' vm['is_a_template'] = False vm['is_control_domain'] = False - vm['domid'] = random.randrange(0, 1 << 16) + vm['domid'] = random.randrange(1, 1 << 16) def stub_out_migration_methods(stubs):