[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-API] How do I create a Snapshot using the XenAPI


  • To: xen-api@xxxxxxxxxxxxx
  • From: "D'Mita Levy" <dlevy022@xxxxxxx>
  • Date: Thu, 10 Sep 2015 12:56:23 -0400
  • Delivery-date: Thu, 10 Sep 2015 16:56:37 +0000
  • List-id: User and development list for XCP and XAPI <xen-api.lists.xen.org>


Hello,

I am a student at FIU working on a school project - so I am a not very experienced. Right now I am trying to use the Xen API code and the C# SDKÂto Snapshot a VM. The project I have so far uses the XenAPI.VM functions and I have been successful in starting and stopping a VM. As an example I perform those actions like this:

  ÂXenRef<VM> vmRef = VM.get_by_uuid(_session, vmUUID);
  ÂVM.start(_session, vmRef.opaque_ref, false, true);

My mentors would like me to try and clone a VM. I have modeled my code after the Run() function from https://github.com/xenserver/xenadmin/tree/master/XenModel/Actions/VM/VMSnapshotCreateAction.cs and I tried to make a snapshot with the following code:

public void snapshotTest(Session _session) {
 ÂXenRef<VM> vmRef = VM.get_by_uuid(_session, GetUUIDByName(vmName));
 ÂSnapshotType m_Type = SnapshotType.DISK; //hardcoded snapshot type
 Âstring snapshot_name = "Testing_Snapshot";

 ÂXenAPI.VM.async_snapshot(_session, vmRef.opaque_ref, snapshot_name);
}

I have two VM's. A Windows XP SP3 VM (No actual OS installed, just the base VM) and an Ubuntu 14.04 Trusty Tahr VM (installed OS and running). The Windows XP SP3 Snapshot gets created successfully but the Ubuntu snapshot does not. I'm not sure what I'm doing wrong as this seems like it should be pretty straight forward. I've also tried to snapshot with an without the VM running and with and without quiesced disk.


Thanks,

D'Mita Levy
Cyber Fellow, Applied Research Center
Florida International University
Â
_______________________________________________
Xen-api mailing list
Xen-api@xxxxxxxxxxxxx
http://lists.xen.org/cgi-bin/mailman/listinfo/xen-api

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.