Beispiel #1
0
 def fake_get_vdi(session, vm_ref):
     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
Beispiel #2
0
 def fake_get_vdi(session, vm_ref):
     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
Beispiel #3
0
    def VM_snapshot(self, session_ref, vm_ref, label):
        status = "Running"
        template_vm_ref = fake.create_vm(label, status, is_a_template=True, is_control_domain=False)

        sr_ref = "fakesr"
        template_vdi_ref = fake.create_vdi(label, sr_ref, read_only=True)

        template_vbd_ref = fake.create_vbd(template_vm_ref, template_vdi_ref)
        return template_vm_ref
Beispiel #4
0
    def VM_snapshot(self, session_ref, vm_ref, label):
        status = "Running"
        template_vm_ref = fake.create_vm(label, status, is_a_template=True,
            is_control_domain=False)

        sr_ref = "fakesr"
        template_vdi_ref = fake.create_vdi(label, sr_ref, read_only=True)

        template_vbd_ref = fake.create_vbd(template_vm_ref, template_vdi_ref)
        return template_vm_ref
Beispiel #5
0
 def fake_import_all_migrated_disks(session, instance):
     vdi_ref = fake.create_vdi(instance['name'], fakesr)
     vdi_rec = fake.get_record('VDI', vdi_ref)
     vdi_rec['other_config']['nova_disk_type'] = 'root'
     return {
         "root": {
             'uuid': vdi_rec['uuid'],
             'ref': vdi_ref
         },
         "ephemerals": {}
     }
Beispiel #6
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']
Beispiel #7
0
 def fake_get_vdi(session, vm_ref):
     vdi_ref = fake.create_vdi("derp", "herp")
     vdi_rec = session.call_xenapi("VDI.get_record", vdi_ref)
     return vdi_ref, {"uuid": vdi_rec["uuid"]}
Beispiel #8
0
 def fake_move_disks(self, instance, disk_info):
     vdi_ref = fake.create_vdi(instance["name"], "fake")
     vdi_rec = fake.get_record("VDI", vdi_ref)
     vdi_rec["other_config"]["nova_disk_type"] = "root"
     return {"uuid": vdi_rec["uuid"], "ref": vdi_ref}
Beispiel #9
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"]
Beispiel #10
0
 def VDI_snapshot(self, session_ref, vm_ref, _1):
     sr_ref = "fakesr"
     return fake.create_vdi('fakelabel', sr_ref, read_only=True)
Beispiel #11
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']
Beispiel #12
0
 def VDI_snapshot(self, session_ref, vm_ref, _1):
     sr_ref = "fakesr"
     return fake.create_vdi('fakelabel', sr_ref, read_only=True)
Beispiel #13
0
 def fake_get_vdi(session, vm_ref):
     vdi_ref = fake.create_vdi('derp', 'herp')
     vdi_rec = session.call_xenapi("VDI.get_record", vdi_ref)
     return vdi_ref, {'uuid': vdi_rec['uuid'], }
Beispiel #14
0
 def fake_import_all_migrated_disks(session, instance):
     vdi_ref = fake.create_vdi(instance['name'], fakesr)
     vdi_rec = fake.get_record('VDI', vdi_ref)
     vdi_rec['other_config']['nova_disk_type'] = 'root'
     return {"root": {'uuid': vdi_rec['uuid'], 'ref': vdi_ref},
             "ephemerals": {}}
Beispiel #15
0
 def fake_move_disks(self, instance, disk_info):
     vdi_ref = fake.create_vdi(instance['name'], 'fake')
     vdi_rec = fake.get_record('VDI', vdi_ref)
     vdi_rec['other_config']['nova_disk_type'] = 'root'
     return {'uuid': vdi_rec['uuid'], 'ref': vdi_ref}
Beispiel #16
0
 def fake_move_disks(self, instance, disk_info):
     vdi_ref = fake.create_vdi(instance['name'], fakesr)
     vdi_rec = fake.get_record('VDI', vdi_ref)
     vdi_rec['other_config']['nova_disk_type'] = 'root'
     return {'uuid': vdi_rec['uuid'], 'ref': vdi_ref}
Beispiel #17
0
 def fake_get_vdi(session, vm_ref):
     vdi_ref = fake.create_vdi('derp', 'herp')
     vdi_rec = session.call_xenapi("VDI.get_record", vdi_ref)
     return vdi_ref, {
         'uuid': vdi_rec['uuid'],
     }
Beispiel #18
0
 def fake_get_vdi(session, vm_ref):
     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