Phone sales support +39 0575 05077
  Phone technical support +39 0575 0508
 

4.2.6 Exporting a virtual disk

Using Aruba’s WsEndUser SetEnqueueVirtualDiskExport method you can queue an operation (Job) to export a Virtual Disk from a virtual server to the FTP area associated with the account specified during authentication.
The path where the virtual disk will be exported is the Export\\ type and the name assigned to the virtual disk exported will be set by the system.

Parameters
disk
Type: ExportVirtualDisk
ExportVirtualDisk class object that represents the virtual disk to be exported.
The ExportVirtualDisk class contains all the useful information to complete the virtual disk export operation: Virtual server ID and type of disk to be exported.

The virtual disk export operation can only be completed if the virtual server has been stopped. Once the operation is queued you will not be able to queue other operations until the first one is complete.

Depending on the type of hypervisor supporting the virtual server, the export procedure for the disk changes according to the following table:
Hypervisor Disk mode
Hyper-V Thin
VMware Fixed

In base al tipo di hypervisor il file verrĂ  esportato nell'area FTP, in bae alle seguenti convenzioni:
Hypervisor Disk mode
Hyper-V \Export\\_.vhd
VMware (file flat) \Export\\_-flat.vmdk
VMware (file header) \Export\\_.vmdk

Let's look at an example of a method that performs a primary virtual disk VirtualDiskTypes.PrimaryVirtualDisk export operation of a virtual server.
//IWsEndUser.SetEnqueueVirtualDiskExport Method (c# .NET)
private static void ExportVirtualDisk(WsEndUserClient client, int serverId)
{
    try
    {
        //creates a new object called diskToExport,
        //ExportVirtualDisk class
        ExportVirtualDisk diskToExport = new ExportVirtualDisk()
        {
            ServerId = serverId,
            VirtualDiskType = VirtualDiskTypes.PrimaryVirtualDisk
        };

        //calls the SetEnqueueVirtualDiskExport method,
        //getting a WsResult object
        WsResult result = client.SetEnqueueVirtualDiskExport(diskToExport);

        //if the call fails; it relaunches the error indicating the message
        if (!result.Success)
            throw new ApplicationException(result.ResultMessage);
    }
    catch (Exception ex)
    {
        //relaunches the generic error
        throw new ApplicationException(ex.Message);
    }
}
//IWsEndUser.setEnqueueVirtualDiskExport Method (JAVA)
private static void ExportVirtualDisk(IWsEndUser client, int serverId)
{
    try
    {
        //creates a new object called diskToExport,
        //ExportVirtualDisk class
        ExportVirtualDisk diskToExport = new ExportVirtualDisk();
        diskToExport.setServerId(serverId);
        diskToExport.setVirtualDiskType(VirtualDiskTypes.PRIMARY_VIRTUAL_DISK);

        //calls the setEnqueueVirtualDiskExport method,
        //getting a WsResult object
        WsResult result = client.setEnqueueVirtualDiskExport(diskToExport);

        //if the call fails; it relaunches the error indicating the message
        if (!result.isSuccess())
        {
            throw new Exception(result.getResultMessage());
        }
    }
    catch (Exception ex)
    {
        //prints the error
        System.out.println(ex);
    }
}

Version
API: v2.8 URL: https://api.dc1.computing.cloud.it/WsEndUser/v2.8/WsEndUser.svc?wsdl
See also

API: v2.8 URL: https://api.dc1.computing.cloud.it/WsEndUser/v2.8/WsEndUser.svc?wsdl