示例#1
0
文件: stubs.py 项目: hsluoyz/patron
 def fake_get_vdi(session, vm_ref, userdevice='0'):
     vdi_ref_parent = fake.create_vdi('derp-parent', fakesr)
     vdi_rec_parent = fake.get_record('VDI', vdi_ref_parent)
     vdi_ref = fake.create_vdi('derp', fakesr,
             sm_config={'vhd-parent': vdi_rec_parent['uuid']})
     vdi_rec = session.call_xenapi("VDI.get_record", vdi_ref)
     return vdi_ref, vdi_rec
示例#2
0
 def fake_get_vdi(session, vm_ref, userdevice='0'):
     vdi_ref_parent = fake.create_vdi('derp-parent', fakesr)
     vdi_rec_parent = fake.get_record('VDI', vdi_ref_parent)
     vdi_ref = fake.create_vdi(
         'derp', fakesr, sm_config={'vhd-parent': vdi_rec_parent['uuid']})
     vdi_rec = session.call_xenapi("VDI.get_record", vdi_ref)
     return vdi_ref, vdi_rec
示例#3
0
 def fake_import_all_migrated_disks(session, instance, import_root=True):
     vdi_ref = fake.create_vdi(instance['name'], fakesr)
     vdi_rec = fake.get_record('VDI', vdi_ref)
     vdi_rec['other_config']['patron_disk_type'] = 'root'
     return {
         "root": {
             'uuid': vdi_rec['uuid'],
             'ref': vdi_ref
         },
         "ephemerals": {}
     }
示例#4
0
文件: stubs.py 项目: hsluoyz/patron
 def fake_import_all_migrated_disks(session, instance, import_root=True):
     vdi_ref = fake.create_vdi(instance['name'], fakesr)
     vdi_rec = fake.get_record('VDI', vdi_ref)
     vdi_rec['other_config']['patron_disk_type'] = 'root'
     return {"root": {'uuid': vdi_rec['uuid'], 'ref': vdi_ref},
             "ephemerals": {}}
示例#5
0
文件: stubs.py 项目: hsluoyz/patron
 def VDI_snapshot(self, session_ref, vm_ref, _1):
     sr_ref = "fakesr"
     return fake.create_vdi('fakelabel', sr_ref, read_only=True)
示例#6
0
文件: stubs.py 项目: hsluoyz/patron
def _make_fake_vdi():
    sr_ref = fake.get_all('SR')[0]
    vdi_ref = fake.create_vdi('', sr_ref)
    vdi_rec = fake.get_record('VDI', vdi_ref)
    return vdi_rec['uuid']
示例#7
0
 def VDI_snapshot(self, session_ref, vm_ref, _1):
     sr_ref = "fakesr"
     return fake.create_vdi('fakelabel', sr_ref, read_only=True)
示例#8
0
def _make_fake_vdi():
    sr_ref = fake.get_all('SR')[0]
    vdi_ref = fake.create_vdi('', sr_ref)
    vdi_rec = fake.get_record('VDI', vdi_ref)
    return vdi_rec['uuid']