Citrix Virtual Apps and Desktops SDK

New-ProvImageScheme

Creates a new image scheme.

Syntax


New-ProvImageScheme [-PreparedImageSchemeName] <String> -HostingUnitName <String> -NetworkMapping <Hashtable> [-VMCpuCount <Int32>] [-VMMemoryMB <Int32>] [-ServiceOffering <String>] [-CustomProperties <String>] [-MachineProfile <String>] [-LoggingId <Guid>] [-BearerToken <String>] [-TraceParent <String>] [-TraceState <String>] [-VirtualSiteId <String>] [-AdminAddress <String>] [<CommonParameters>]

New-ProvImageScheme [-PreparedImageSchemeName] <String> -HostingUnitUid <Guid> -NetworkMapping <Hashtable> [-VMCpuCount <Int32>] [-VMMemoryMB <Int32>] [-ServiceOffering <String>] [-CustomProperties <String>] [-MachineProfile <String>] [-LoggingId <Guid>] [-BearerToken <String>] [-TraceParent <String>] [-TraceState <String>] [-VirtualSiteId <String>] [-AdminAddress <String>] [<CommonParameters>]

<!--NeedCopy-->

Detailed Description

Lets you create a new image scheme. The image scheme is a collection of all of the data that is required to prepare a template against which virtual machines can be created. An image scheme will be used in New-ImageVersion command to prepare an image.

It therefore requires the following: Hosting Unit A reference to an item defined in the Host Service that defines the hypervisor, the network, and the storage to be used.

This cmdlet requires information to be provided that is retrieved using other snap-ins that form part of the Citrix Machine Creation Services: Hosting Unit Service Snapin The snap-in that provides information about the hypervisors.

Parameters

Name Description Required? Pipeline Input Default Value
PreparedImageSchemeName The name of the image scheme to be created. This must be a name that is not being used by an existing image scheme, and it must not contain any of the following characters \/;:#.*?=<>|”“’ true false  
HostingUnitName The name of the hosting unit used for the image scheme. true false  
HostingUnitUid The identifier for the hosting unit used for the image scheme. true false  
NetworkMapping Specifies how the attached NICs are mapped to networks. If this parameter is omitted, provisioned VM in New-ImageVersion command is created with a single NIC, which is mapped to the default network in the HostingUnit. If this parameter is supplied, machine is created with the number of NICs specified in the map, and each NIC is attached to the specified network. true false  
VMCpuCount The number of processors used by virtual machines created from the image scheme. false false The number of CPUs assigned to the base image VM snapshot or VM template.
VMMemoryMB The maximum amount of memory used by virtual machines created from the image scheme. false false The amount of memory assigned to the base image VM snapshot or VM template.
ServiceOffering The Service Offering to use when creating machines in Cloud Hypervisors. false false  
CustomProperties The properties of the image scheme that are specific to the target hosting infrastructure. false false  
MachineProfile The inventory path to the source that is used as a template. This profile identifies the values for the VMs created by the catalog. This must be a path to an item in the same hosting unit that the hosting unit name or hosting unit UID refers to. Valid paths are of the format: XDHyp:\HostingUnits<HostingUnitName><path><VMName>.vm false false  
LoggingId Specifies the identifier of the high-level operation this cmdlet call forms a part of. Citrix Studio and Director typically create high-level operations. PowerShell scripts can also wrap a series of cmdlet calls in a high-level operation by way of the Start-LogHighLevelOperation and Stop-LogHighLevelOperation cmdlets. false false  
BearerToken Specifies the bearer token assigned to the calling user false false  
TraceParent Specifies the trace parent assigned for internal diagnostic tracing use false false  
TraceState Specifies the trace state assigned for internal diagnostic tracing user false false  
VirtualSiteId Specifies the virtual site the PowerShell snap-in will connect to. false false  
AdminAddress The address of a Citrix Virtual Apps and Desktops controller the PowerShell snap-in will connect to. You can provide this as a host name or an IP address. false false Localhost. Once a value is provided by any cmdlet, this value becomes the default.

Input Type

Return Values

Citrix.Machinecreation.Sdk.Imagescheme

This object provides details of the image scheme and contains the following information:

  • CpuCount <int> The number of processors that will be used to create VMs. CustomProperties <string> Properties of the image scheme which that are specific to the target hosting infrastructure. (See about_ProvCustomProperties) HostingUnitName <string> The name of the hosting unit being used by this image scheme. HostingUnitUid <Guid> The unique identifier of the hosting unit being used by this image scheme. MachineProfile <string> The inventory path to the source VM used by the image scheme as a template. MemoryMB <int> The maximum amount of memory that will be used to created VMs in MB. NetworkMaps <Citrix.MachineCreation.Sdk.NetworkMap[]> The NIC/network mappings that will be used to create VMs. PreparedImageSchemeName <string> The name of this image scheme. PreparedImageSchemeUid <Guid> The unique identifier for this image scheme. ServiceOffering <string> The service offering that the scheme uses when creating VMs in Cloud Hypervisors.

Notes

In case of failure, the following errors can result.

  • DatabaseError: An error occurred in the service while attempting a database operation.

  • DatabaseNotConfigured: The operation could not be completed because the database for the service is not configured.

  • ServiceStatusInvalidDb: An error occurred in the service while attempting a database operation. Communication with the database failed for for various reasons.

  • DatabaseMissingCapabilites: The database supporting the service instance being used has not been upgraded to support the personal vDisk feature.

  • CommunicationError: An error occurred while communicating with the service.

  • PermissionDenied: The user does not have administrative rights to perform this operation.

  • ConfigurationLoggingError: The operation could not be performed because of a configuration logging error.

  • ScopeNotFound: One or more of the scopes nominated for the new image scheme do not exist.

  • ExceptionThrown: An unexpected error occurred. To locate more details, see the Windows event logs on the controller being used, or examine the XenDesktop logs. ImageSchemeNameAlreadyExists The specified image scheme name has already existed.

Examples

Example 1


C:\PS> New-ProvImageScheme -PreparedImageSchemeName XenPS -HostingUnitName XenHu

CpuCount                 : 0

CustomProperties         :

HostingUnitName          : XenHu

HostingUnitUid           : e5d4a2c9-6650-4cfc-93cc-1686db82b92e

MachineProfile           :

MemoryMB                 : 0

NetworkMaps              : []

PreparedImageSchemeName  : XenPS

PreparedImageSchemeUid   : 85bd21c6-851b-420a-a702-2fa2ee6f0052

ServiceOffering          :

<!--NeedCopy-->

Description

Creates a new image scheme with the name “XenPS” using the hosting unit “XenHu”.

Example 2


C:\PS> New-ProvImageScheme -PreparedImageSchemeName azurescheme -HostingUnitName azure -ServiceOffering "XDHyp:\HostingUnits\azure\serviceoffering.folder\Standard_B2ms.serviceoffering" -NetworkMapping @{"0"="XDHyp:\HostingUnits\azure\virtualprivatecloud.folder\East US.region\virtualprivatecloud.folder\hu.resourcegroup\hu.virtualprivatecloud\default.network"}

CpuCount                 : 0

CustomProperties         :

HostingUnitName          : azure

HostingUnitUid           : e5d4a2c9-6650-4cfc-93cc-1686db82b92e

MachineProfile           :

MemoryMB                 : 0

NetworkMaps              : [{"DeviceId":"0","NetworkId":"","NetworkPath":"virtualprivatecloud.folder\\East US.region\\virtualpr

                           ivatecloud.folder\\hu.resourcegroup\\hu.virtualprivatecloud\\default.network"}]

PreparedImageSchemeName  : myImageScheme

PreparedImageSchemeUid   : b5a55401-ad36-4f53-b0e0-dbb6a5bdf6fd

ServiceOffering          : serviceoffering.folder\Standard_B2ms.serviceoffering

<!--NeedCopy-->

Description

Creates a new image scheme with the name “azurescheme” using the hosting unit “azure”.

New-ProvImageScheme