Click or drag to resize

IWsEndUserCheckEnqueueServerCreation Method

Performs a creation of a virtual server. By the method SetEnqueueServerCreation() of Aruba is WsEndUser can create a virtual server by specifying the characteristics of the various resources that make up. The method, in the case of a CREATION OF virtualMachine with a custom template or template Premium (generated by selling a template created by a director of a company) retrieves the image file required to create a car space FTP User that created it.

Namespace:  Aruba.Cloud.WsEndUser
Assembly:  Aruba.Cloud.WsEndUser (in Aruba.Cloud.WsEndUser.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
[OperationContractAttribute]
WsResult CheckEnqueueServerCreation()

Return Value

Type: WsResult
The method returns an object WsResult containing information on the outcome of the method call. For further details on the information returned by the method refer to the definition of the class WsResult.
Remarks
If it is required to create a SmartVMWare virtual server it is necessary to set the property SmartVMWarePackageID, see the details of this property for more info.
Examples
In the following example in C# code, we create a new Virtual Machine Server. Notice the AdditionaLicenses field, that needs to be populated only when connecting an HD from FTP.
private static void CreateServer()
{
  try
  {
    NewServer serverToCreate = new NewServer()
    {
      AdministratorPassword = "Passw@ord",
      CPUQuantity = 4,
      Name = "NewServer01",
      OSTemplateId = 5,
      RAMQuantity = 8 ,
          /* Additional licenses are used only when an existing HardDisk (loaded through FTP) is connected to VM 
               and the user must specify the licenses used in that template.
          */
      AdditionalLicenses = new List<TemplateLicense>()
      {
        new TemplateLicense(){TemplateLicenseID = 60, DefaultValue = 1 },
        new TemplateLicense(){TemplateLicenseID = 93, DefaultValue = 5 }
      },
      VirtualDisks = new List<VirtualDiskDetails>()
      {
        new VirtualDiskDetails (){ Size = 10, VirtualDiskType = VirtualDiskTypes.PrimaryVirtualDisk },
        new VirtualDiskDetails (){ Size = 50, VirtualDiskType = VirtualDiskTypes.AdditionalVirtualDisk1 },
      }.ToArray(),
      Note = "Server creato tramite chiamata a WSEndUser",
      NetworkAdaptersConfiguration = new List<NetworkAdapterConfiguration>()
      {
        new NetworkAdapterConfiguration ()
        {
          NetworkAdapterType = NetworkAdapterTypes.Ethernet0,
          PrivateVLan = new PrivateVLanDetails()
          {
            Gateway = "82.149.68.75",
            IPAddress = "95.110.154.9",
            SubNetMask = "255.255.255.0",
            PrivateVLanResourceId = 2647
          }
        }
      }.ToArray()
    };

    WsResult result = client.SetEnqueueServerCreation(serverToCreate);

    if (!result.Success)
    {
      throw new ApplicationException(String.Format(
      "An error has occurred while invoking SetEnqueueServerCreation(). {0}", result.ResultMessage));
    }
  }
  catch (Exception ex)
  {
    //rethrowing error
    throw new ApplicationException(String.Format("An error has occurred while taking a snapshot{0}", ex.Message));
  }
}
See Also