~hudson-openstack/nova/trunk

« back to all changes in this revision

Viewing changes to nova/virt/xenapi/fake.py

  • Committer: Tarmac
  • Author(s): Ewan Mellor
  • Date: 2011-08-29 17:11:41 UTC
  • mfrom: (1499.4.2 lp831599)
  • Revision ID: tarmac-20110829171141-87kqyripilpw3bg7
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.

Show diffs side-by-side

added added

removed removed

Lines of Context:
51
51
"""
52
52
 
53
53
 
 
54
import random
54
55
import uuid
55
56
 
56
57
from pprint import pformat
103
104
 
104
105
def create_vm(name_label, status,
105
106
              is_a_template=False, is_control_domain=False):
 
107
    domid = status == 'Running' and random.randrange(1, 1 << 16) or -1
106
108
    return _create_object('VM',
107
109
                          {'name_label': name_label,
 
110
                           'domid': domid,
108
111
                           'power-state': status,
109
112
                           'is_a_template': is_a_template,
110
113
                           'is_control_domain': is_control_domain})