Citrix Daas SDK

New-ProvImageScheme

Creates a new image scheme.

Syntax

New-ProvImageScheme
   [-PreparedImageSchemeName] <String>
   -HostingUnitName <String>
   [-VMCpuCount <Int32>]
   [-VMMemoryMB <Int32>]
   -NetworkMapping <Hashtable>
   [-ServiceOffering <String>]
   [-CustomProperties <String>]
   [-MachineProfile <String>]
   [-LoggingId <Guid>]
   [<CitrixCommonParameters>]
   [<CommonParameters>]
<!--NeedCopy-->
New-ProvImageScheme
   [-PreparedImageSchemeName] <String>
   -HostingUnitUid <Guid>
   [-VMCpuCount <Int32>]
   [-VMMemoryMB <Int32>]
   -NetworkMapping <Hashtable>
   [-ServiceOffering <String>]
   [-CustomProperties <String>]
   [-MachineProfile <String>]
   [-LoggingId <Guid>]
   [<CitrixCommonParameters>]
   [<CommonParameters>]
<!--NeedCopy-->

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.

Examples

EXAMPLE 1

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

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-->

EXAMPLE 2

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

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-->

Parameters

-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 \/;:#.*?=<>|[]()””’

Type: String
Position: 2
Default value: None
Required: True
Accept pipeline input: False
Accept wildcard characters: False

-HostingUnitName

The name of the hosting unit used for the image scheme.

Type: String
Position: Named
Default value: None
Required: True
Accept pipeline input: False
Accept wildcard characters: False

-HostingUnitUid

The identifier for the hosting unit used for the image scheme.

Type: Guid
Position: Named
Default value: None
Required: True
Accept pipeline input: False
Accept wildcard characters: 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.

Type: Hashtable
Position: Named
Default value: None
Required: True
Accept pipeline input: False
Accept wildcard characters: False

-VMCpuCount

The number of processors used by virtual machines created from the image scheme.

Type: Int32
Position: Named
Default value: The number of CPUs assigned to the base image VM snapshot or VM template.
Required: False
Accept pipeline input: False
Accept wildcard characters: False

-VMMemoryMB

The maximum amount of memory used by virtual machines created from the image scheme.

Type: Int32
Position: Named
Default value: The amount of memory assigned to the base image VM snapshot or VM template.
Required: False
Accept pipeline input: False
Accept wildcard characters: False

-ServiceOffering

The Service Offering to use when creating machines in Cloud Hypervisors.

Type: String
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False

-CustomProperties

The properties of the image scheme that are specific to the target hosting infrastructure.

Type: String
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: 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

Type: String
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: 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.

Type: Guid
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False

CitrixCommonParameters

This cmdlet supports the common Citrix parameters: -AdminAddress, -AdminClientIP, -BearerToken, -TraceParent, -TraceState and -VirtualSiteId. For more information, see about_CitrixCommonParameters.

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

None

You can’t pipe objects to this cmdlet.

Outputs

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.

Error Codes


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.

New-ProvImageScheme