New-ProvScheme
Creates a new provisioning scheme.
Syntax
New-ProvScheme [-ProvisioningSchemeName] <String> -HostingUnitName <String> -IdentityPoolName <String> -MasterImageVM <String> [-VMCpuCount <Int32>] [-VMMemoryMB <Int32>] [-CleanOnBoot] [-UseWriteBackCache] [-Scope <String[]>] [-NoImagePreparation] [-NetworkMapping <Hashtable>] [-Metadata <Hashtable>] [-ServiceOffering <String>] [-SecurityGroup <String[]>] [-DedicatedTenancy] [-TenancyType <String>] [-MachineProfile <String>] [-CustomProperties <String>] [-ResetAdministratorPasswords] [-FunctionalLevel <String>] [-UseFullDiskCloneProvisioning] [-MasterImageNote <String>] [-RunAsynchronously] [-PurgeJobOnSuccess] [-InitialBatchSizeHint <Int32>] [-PVSSite <String>] [-PVSServer <String>] [-PVSVDisk <String>] [-PVS] [-LoggingId <Guid>] [-BearerToken <String>] [-TraceParent <String>] [-TraceState <String>] [-VirtualSiteId <String>] [-AdminAddress <String>] [<CommonParameters>]
New-ProvScheme [-ProvisioningSchemeName] <String> -HostingUnitUid <Guid> -IdentityPoolUid <Guid> -MasterImageVM <String> [-VMCpuCount <Int32>] [-VMMemoryMB <Int32>] [-CleanOnBoot] [-UseWriteBackCache] [-Scope <String[]>] [-NoImagePreparation] [-NetworkMapping <Hashtable>] [-Metadata <Hashtable>] [-ServiceOffering <String>] [-SecurityGroup <String[]>] [-DedicatedTenancy] [-TenancyType <String>] [-MachineProfile <String>] [-CustomProperties <String>] [-ResetAdministratorPasswords] [-FunctionalLevel <String>] [-UseFullDiskCloneProvisioning] [-MasterImageNote <String>] [-RunAsynchronously] [-PurgeJobOnSuccess] [-InitialBatchSizeHint <Int32>] [-PVSSite <String>] [-PVSServer <String>] [-PVSVDisk <String>] [-PVS] [-LoggingId <Guid>] [-BearerToken <String>] [-TraceParent <String>] [-TraceState <String>] [-VirtualSiteId <String>] [-AdminAddress <String>] [<CommonParameters>]
<!--NeedCopy-->
Detailed Description
Allows you to create a new provisioning scheme. The creation process makes a copy of the hard disk attached to a virtual machine snapshot or VM template and stores it in every storage location that the hosting unit referenced by the provisioning scheme defines. This is a long-running task and typically takes several minutes to complete (depending on the size of the hard disk that is being copied and the number of snapshots that the hard disk consists of).
A snapshot or VM template must be used rather than a VM, so that the content of the hard disk for the provisioning scheme can be easily determined.
Because the snapshot or VM template are specified using a path into the Citrix Host Service PowerShell Provider, the Citrix Host Service PowerShell snap-in must also be loaded to use this cmdlet.
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. AD Identity Service Snapin The snap-in that provides information about the identity pools.
The provisioning scheme is a collection of all of the data that is required to form a template against which virtual machines can be created. 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. Identity Pool A reference to the collection of Active Directory accounts that is used for VMs created from the provisioning scheme.
Related Commands
Parameters
Input Type
Return Values
System.Guid
When the RunAsynchronously identifier is specified, this GUID is returned and provides the task identifier.
System.Management.Automation.Pscustomobject
This object provides details of the task that was run and contains the following information:
-
TaskId <Guid> The identifier for the task that was performed.
-
Type <Citrix.XDInterServiceTypes.JobType> The type of task. For new provisioning scheme tasks, this is always NewProvisioningScheme.
-
Status <string> Where in its lifecycle the task is.
-
CurrentOperation <string> Operation specific phase of the overall “Running” task state.
-
TaskExpectedCompletion <DateTime> The date and time at which the task is expected to complete.
-
LastUpdateTime <DateTime> The date and time of the last task status update.
-
ActiveElapsedTime <int> Number of seconds the task has taken for active execution.
-
DateStarted <DateTime> The date and time when the task was started.
-
DateFinished <DateTime> The date and time when the task was completed.
-
TerminatingError < Citrix.Fma.Sdk.ServiceCore.CommonCmdlets.TaskterminatingError> Diagnostic information if the task completely fails.
-
Storage <Citrix.MachineCreation.Sdk.NewProvSchemeStorage[]> Storage objects to be used for the new provisioning scheme task.
-
WorkflowStatus <System.Workflow.Runtime.WorkflowStatus> Indicates the status of the workflow that is used to process the task.
-
Warnings <Citrix.MachineCreation.Sdk.ProvSchemeWarning[]> Warnings associated with the new provisioning scheme task.
-
ProvisioningSchemeName <string> The name of the provisioning scheme being created.
-
MasterImage <string> The inventory path of the VM snapshot or template to be used as the master VM image for the task.
-
IdentityPoolName <string> The name of the identity pool to be used by the new provisioning scheme.
-
IdentityPoolUid <guid> The unique identifier name of the identity pool to be used by the new provisioning scheme.
-
HostingUnitName <string> The name of the hosting unit to be used by the new provisioning scheme.
-
HostingUnitUid <guid> The unique identifier of the hosting unit to be used by the new provisioning scheme.
-
CustomProperties <string> The properties of the provisioning scheme that are specific to the target hosting infrastructure.
-
InitialBatchSizeHint <int> The number of VMs that are expected to be added to the scheme as an initial batch.
-
ProvisioningSchemeUid <Guid> The unique identifier of the provisioning scheme being created.
-
TaskState <Citrix.MachineCreation.Sdk.NewProvisioningSchemeState> The state of the task. This can be any of the following: Processing The task has begun but has not done anything yet. LocatingResources, The workflow is locating resources from other services. HostingUnitNotFound The task failed because the required hosting unit could not be located. VirtualMachineSnapshotNotFound The task failed because the required VM snapshot or VM template could not be located. ConsolidatingMasterImage The task is consolidating the master image. ReplicatingConsolidatedImageToAllStorage The task is replicating the consolidated master image. StoringProvisioningScheme The task is storing the provisioning scheme data in the database. Finished The task completed with no errors. ProvisioningSchemeAlreadyExists The task failed because a provisioning scheme with the same name already exists. IdentityPoolNotFound The task failed because the specified identity pool could not be found. MasterVMImageIsNotPartOfProvisioningSchemeHostingUnit, The task failed because the hosting unit from which the master image originated is not the same hosting unit that the provisioning scheme is using. MasterVmImageIsNotASnapshot The task failed because the master VM path does not refer to a snapshot or VM template item. ProvisioningSchemeNotFound The task failed because it could not find a provisioning scheme with the specified name. TaskAlreadyRunningForProvisioningScheme The task failed because a task for a provisioning scheme with the same name is already running. InvalidMasterVMConfiguration The task failed because the VM snapshot or VM template specified as the master has an invalid configuration. InvalidMasterVMState The task failed because the VM snapshot or VM template specified as the master is currently in an invalid state. InsufficientResources The task failed because the hypervisor did not have enough resources to complete the task. DiskConsolidationFailed The disk consolidation task failed. Details are in the task state information string. StorageNotFound The task failed because no associated storage was found in the hosting unit. ConfigurationError The task failed because the service is unable to contact one of the other services. This is because not all appropriate Configuration Service registrations have been performed. RequestedFeatureNotEnabled The task failed because a requested feature is not enabled. MachineProfileNotSupported The task failed because machine profile is not supported. FailedToReadMachineProfile Failed to read the Machine Profile. Canceled The task was stopped by user intervention (using Stop-ProvTask).
-
TaskStateInformation <string> Additional information about the current task state.
-
TaskProgress <double> The progress of the task 0-100%.
-
DiskSize <int> The disk size (in GB) that will be used to create VMs.
-
MasterImageNote <string> The note of the master image.
-
WriteBackCacheDiskSize <int> The size of any write-back cache disk (zero if the write-back cache feature was not selected).
-
WriteBackCacheMemorySize <int> The size of the write-back cache (zero if the write-back cache feature was not selected).
-
Scopes <Citrix.Fma.Sdk.ServiceCoreScopeReference[]> The delegated administration scopes to which the scheme will belong.
-
NetworkMaps <Citrix.MachineCreation.Sdk.NetworkMap[]> The list of NIC to network associations, if specified.
-
ProvisioningSchemeMetadata <System.Collections.Generic.Dictionary[string, string];> The metadata to apply to the provisioning scheme, if specified.
-
ServiceOffering <string> The service offering that the scheme uses when creating VMs in Cloud Hypervisors.
-
SecurityGroups <string[]> The security groups that will be applied to machines created in Cloud Hypervisors.
-
DedicatedTenancy <bool> Whether to use dedicated tenancy when creating VMs in Cloud Hypervisors.
-
ResetAdministratorPasswords <bool> Whether to reset the passwords for administrator accounts on created machines.
-
StatusMessageSubstitutions <string[]> List of strings to be substituted into custom error or status messages from provisioning plug-ins.
-
GpuTypeId <string> The id of the GPU type used by this provisioning scheme, null if no GPU.
-
UseFullDiskCloneProvisioning <bool> Indicates whether the machines are provisioned using the dedicated full disk clone feature.
Notes
The cmdlet is associated with a task of type NewProvisioningScheme, and while active will move through the following operations (CurrentOperation field): ValidatingInputs ConsolidatingMasterImage PreparingMasterImage ReplicatingMasterImage CommittingScheme Only one long-running task for each provisioning scheme can be processed at a time. In case of failure, the following errors can result.
JobCreationFailed The requested task could not be started.
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.
CommunicationError An error occurred while communicating with the service.
InvalidParameterCombination Both PurgeJobOnSuccess and RunAsynchronously were specified. When running asynchronously, the cmdlet terminates before the job does, so it cannot clean up the completed job.
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 provisioning scheme do not exist.
WorkflowHostUnavailable The task could not be started because the database connection is inactive.
ExceptionThrown An unexpected error occurred. For more details, see the Windows event logs on the controller being used, or Citrix Virtual Apps and Desktops logs.
VhdParametersMustBeSupplied When parameter VhdTemplateSource or VhdResultDestination is supplied, both parameters are required to be supplied.
ServiceDoesNotSupportFullDiskClone The full disk clone parameter is being used when the service does not support the full disk clone feature. Upgrade the service or remove the parameter.
FullDiskCloneDoesNotSupportCleanOnBootVMs The full disk clone functionality is applicable to dedicated provisioned machines only.
CannotUseWriteBackCacheWithCleanOnBootDisabled Cannot turn on writebackcache on persistent catalog. Do not use -UseWriteBackCache without specifying -CleanOnBoot.
Examples
Example 1
C:\PS> New-ProvScheme -ProvisioningSchemeName XenPS -HostingUnitName XenHu -IdentityPoolName idPool1 -CleanOnBoot -MasterImageVM XDHyp:\HostingUnits\XenHU\Base.vm\Base.snapshot
TaskId : 90e93b9d-a225-4701-ad50-fa1546af35ac
Type : NewProvisioningScheme
Status : Finished
CurrentOperation :
TaskExpectedCompletion :
LastUpdateTime : 17/05/2020 08:24:08
ActiveElapsedTime : 11
DateStarted : 17/05/2020 08:22:22
DateFinished : 17/05/2020 08:24:08
TerminatingError :
Storage : {}
WorkflowStatus : Completed
Warnings : {}
ProvisioningSchemeName : XenPS
MasterImage : XDHyp:\HostingUnits\XenHU\Base.vm\Base.snapshot
IdentityPoolName : idPool1
IdentityPoolUid : 03743136-e43b-4a87-af74-ab71686b3c16
HostingUnitName : XenHU
HostingUnitUid : 01a4a008-8ce8-4165-ba9c-cdf15a6b0501
CustomProperties :
InitialBatchSizeHint : 0
ProvisioningSchemeUid : 7585f0de-192e-4847-a6d8-22713c3a2f42
TaskState : Finished
TaskStateInformation :
TaskProgress : 100
DiskSize : 24
MasterImageNote :
WriteBackCacheDiskSize : 127
WriteBackCacheMemorySize : 256
Scopes : {}
NetworkMaps : {0}
ProvisioningSchemeMetadata : {}
ServiceOffering :
SecurityGroups :
DedicatedTenancy : False
ResetAdministratorPasswords : True
StatusMessageSubstitutions :
GpuTypeId :
UseFullDiskCloneProvisioning : False
<!--NeedCopy-->
Description
Creates a new provisioning scheme with the name “XenPS” using the hosting unit “XenHu” and the identity pool “idPool1” from the master VM snapshot called “Base.snapshot”.
Example 2
C:\PS> New-ProvScheme -ProvisioningSchemeName XenPS -HostingUnitName XenHu -IdentityPoolName idPool1 -CleanOnBoot -MasterImageVM XDHyp:\HostingUnits\XenHU\Base.vm\Base.snapshot -RunAsynchronously
Guid
----
6dd85fec-96cf-46b1-9cd4-d8ba7d06e85b
C:\PS>Get-ProvTask -TaskID 6dd85fec-96cf-46b1-9cd4-d8ba7d06e85b
TaskId : 6dd85fec-96cf-46b1-9cd4-d8ba7d06e85b
Type : NewProvisioningScheme
Status : Finished
CurrentOperation :
TaskExpectedCompletion :
LastUpdateTime : 17/05/2020 08:24:08
ActiveElapsedTime : 11
DateStarted : 17/05/2020 08:22:22
DateFinished : 17/05/2020 08:24:08
TerminatingError :
Storage : {}
WorkflowStatus : Completed
Warnings : {}
ProvisioningSchemeName : XenPS
MasterImage : XDHyp:\HostingUnits\XenHU\Base.vm\Base.snapshot
IdentityPoolName : idPool1
IdentityPoolUid : 03743136-e43b-4a87-af74-ab71686b3c16
HostingUnitName : XenHU
HostingUnitUid : 01a4a008-8ce8-4165-ba9c-cdf15a6b0501
CustomProperties :
InitialBatchSizeHint : 0
ProvisioningSchemeUid : 7585f0de-192e-4847-a6d8-22713c3a2f42
TaskState : Finished
TaskStateInformation :
TaskProgress : 100
DiskSize : 24
MasterImageNote :
WriteBackCacheDiskSize : 127
WriteBackCacheMemorySize : 256
Scopes : {}
NetworkMaps : {0}
ProvisioningSchemeMetadata : {}
ServiceOffering :
SecurityGroups :
DedicatedTenancy : False
ResetAdministratorPasswords : True
StatusMessageSubstitutions :
GpuTypeId :
UseFullDiskCloneProvisioning : False
<!--NeedCopy-->
Description
Creates a new provisioning scheme with the name “XenPS” using the hosting unit “XenHu” and the identity pool “idPool1” from the master VM snapshot called “Base.snapshot” asynchronously. To get the task details, use Get-ProvTask -TaskID <task id>.
Example 3
C:\PS>$provScheme = New-ProvScheme -ProvisioningSchemeName XenPS2 -HostingUnitName XenHu -IdentityPoolName idPool1 -CleanOnBoot -MasterImageVM XDHyp:\HostingUnits\XenHU\Base.vm\Base.snapshot
C:\PS>$provScheme
TaskId : d726222a-04b5-4098-b9ac-db85ed9d351b
Type : NewProvisioningScheme
Status : Finished
CurrentOperation :
TaskExpectedCompletion :
LastUpdateTime : 17/05/2020 08:24:08
ActiveElapsedTime : 11
DateStarted : 17/05/2020 08:22:22
DateFinished : 17/05/2020 08:24:08
TerminatingError :
Storage : {}
WorkflowStatus : Completed
Warnings : {}
ProvisioningSchemeName : XenPS2
MasterImage : XDHyp:\HostingUnits\XenH\Base.vm\Base.snapshot
IdentityPoolName : idPool1
IdentityPoolUid : 03743136-e43b-4a87-af74-ab71686b3c16
HostingUnitName : XenHU
HostingUnitUid : 01a4a008-8ce8-4165-ba9c-cdf15a6b0501
CustomProperties :
InitialBatchSizeHint : 0
ProvisioningSchemeUid : 7585f0de-192e-4847-a6d8-22713c3a2f42
TaskState : Finished
TaskStateInformation :
TaskProgress : 100
DiskSize : 24
MasterImageNote :
WriteBackCacheDiskSize : 127
WriteBackCacheMemorySize : 256
Scopes : {}
NetworkMaps : {0}
ProvisioningSchemeMetadata : {}
ServiceOffering :
SecurityGroups :
DedicatedTenancy : False
ResetAdministratorPasswords : True
StatusMessageSubstitutions :
GpuTypeId :
UseFullDiskCloneProvisioning : False
<!--NeedCopy-->
Description
Creates a new provisioning scheme with the name “XenPS2” using the hosting unit “XenHu” and the identity pool “idPool1” from the master VM snapshot called “Base.snapshot”. The operation runs synchronously, and the return value contains the task details.
Example 4
C:\PS>$provScheme = New-ProvScheme -ProvisioningSchemeName XenPS2 -HostingUnitName AzureHostingUnit -IdentityPoolName idPool1 -CleanOnBoot -MasterImageVM XDHyp:\HostingUnits\AzureHostingUnit\image.folder\RG.resourcegroup\masterImage.manageddisk -MachineProfile XDHyp:\HostingUnits\AzureHostingUnit\machineprofile.folder\RG.resourcegroup\TS.templatespec\1.0.templatespecversion
<!--NeedCopy-->
Description
Creates a new provisioning scheme with the name “XenPS2” using the hosting unit “AzureHostingUnit” and the identity pool “idPool1” from the master VM snapshot called “Base.snapshot” and using the machine profile called 1.0. The operation runs synchronously, and the return value contains the task details.