Ejemplo n.º 1
0
 def fake_get_vdi(cls, session, vm_ref):
     vdi_ref = fake.create_vdi(name_label='derp',
                               read_only=False,
                               sr_ref='herp',
                               sharable=False)
     vdi_rec = session.call_xenapi("VDI.get_record", vdi_ref)
     return vdi_ref, {
         'uuid': vdi_rec['uuid'],
     }
Ejemplo n.º 2
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, read_only=True, sr_ref=sr_ref, sharable=False)

        template_vbd_ref = fake.create_vbd(template_vm_ref, template_vdi_ref)
        return template_vm_ref
Ejemplo n.º 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,
                                           read_only=True,
                                           sr_ref=sr_ref,
                                           sharable=False)

        template_vbd_ref = fake.create_vbd(template_vm_ref, template_vdi_ref)
        return template_vm_ref
Ejemplo n.º 4
0
def _make_fake_vdi():
    sr_ref = fake.get_all('SR')[0]
    vdi_ref = fake.create_vdi('', False, sr_ref, False)
    vdi_rec = fake.get_record('VDI', vdi_ref)
    return vdi_rec['uuid']
Ejemplo n.º 5
0
 def fake_get_vdi(cls, session, vm_ref):
     vdi_ref = fake.create_vdi(name_label="derp", read_only=False, sr_ref="herp", sharable=False)
     vdi_rec = session.call_xenapi("VDI.get_record", vdi_ref)
     return vdi_ref, {"uuid": vdi_rec["uuid"]}
Ejemplo n.º 6
0
def _make_fake_vdi():
    sr_ref = fake.get_all("SR")[0]
    vdi_ref = fake.create_vdi("", False, sr_ref, False)
    vdi_rec = fake.get_record("VDI", vdi_ref)
    return vdi_rec["uuid"]