VMware Cloud Community
Kovacija
Contributor
Contributor
Jump to solution

Error: ChangeSID property of the customization specification should be set to TRUE...

Hi,

 

I develop an orchestrated process for new virtual server provisioning. Environment is vCenter 5.5, PowerCLI 6.3.0.0, PowerShell 4.0. Key element is vCenter template with Windows Server 2012 R2.

To finalize the operating system we use OS Customization Specification file which is built “on the fly” before creating new VM.

Basically there is two scenarios. First scenario is when we let the OS Customization Specification process to perform sysprep or in vCenter terminology ChangeSID. This one work as expected.

 

The second scenario is when the operating system in template is already sysprep-ed. In this case we do not need sysprep again, right. So, we create OS Customization Specification file using

 

New-OSCustomizationSpec cmdlet and omit -ChangeSid parameter. Cmdlet reference vSphere PowerCLI Reference (63R1) also shows  that -ChangeSid is not required parameter.

 

But when I try to create new VM with New-VM cmdlet, and specify above OS Customization Specification file (which doesn’t include parameter -ChangeSid), I get the following error:

 

New-VM : 6.7.2016 16:01:25    New-VM        ChangeSID property of the customization specification should be set to TRUE because the guest OS 'Microsoft Windows Server 2012 (64-bit) ' doesn't support FALSE value.

 

It’s not matter which operating system version I select under Settings|Options|General Options|Guest Operating System|Version settings.

 

I understand error massage but it’s strange in two aspects. First is that the parameter is not required (look cmdlet reference link above) and other is that scenario in which operating system is already sysprep-ed and is completely legitimate.

 

Any help, hints or trick how to solve that, will be appreciated.

 

Thanks in advanced.

 

Regards,

  Ivan

1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

I did some further investigation into this, and the problem is actually the documentation, not the cmdlet itself.

To test I used the API methods instead of the cmdlet.

$oscName = 'MyCustSpec'

$templateName = 'MyTemplate'

$vmName = 'MyNewVM'

$folderName = 'MyFolder'

$resourcePoolName = 'MyPool'

$si = Get-View ServiceInstance

$oscMgr = Get-View -Id $si.Content.CustomizationSpecManager

$osc = $oscMgr.GetCustomizationSpec($oscName)

$Template = Get-template -Name $templateName

$folder = Get-Folder -Name $folderName

$rp = Get-ResourcePool -Name $resourcePoolName

$spec = New-Object VMware.Vim.VirtualMachineCloneSpec

$spec.Customization = $osc.Spec

$spec.Customization.Options.ChangeSID = $false

$spec.Location = New-Object VMware.Vim.VirtualMachineRelocateSpec

$spec.Location.Pool = $rp.ExtensionData.MoRef

$Template.ExtensionData.CloneVM($folder.ExtensionData.MoRef,$vmName,$spec)

And then you get the error

sid2.png

The ChangeSID option is apparently only available for Windows OS that are pre-Vista.

From Vista onwards the SID will always be changed, which is also the way the API Reference states it under CustomizationWinOptions

sid.png

Since W2K3 and WinXP are not supported anymore, this, imho, has become an obsolete parameter.

For your scenario, you could "copy" the VM instead of cloning.

See for example my HL Tools – Part 1 – Clone a VM without vCenter post.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

4 Replies
LucD
Leadership
Leadership
Jump to solution

This looks like a "feature".

One thing to check, are you using a temp (NonPeristent) OSCustomizationSpec ?

If yes, can you try with a Persistent one?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
Kovacija
Contributor
Contributor
Jump to solution

Hi Luc,

no I use Persistent type.

Yes it could be that this is a feature but what is bothering me in this case is cmdlet referenc where parameter "Required" is false.

Regards,

Ivan

0 Kudos
LucD
Leadership
Leadership
Jump to solution

I did some further investigation into this, and the problem is actually the documentation, not the cmdlet itself.

To test I used the API methods instead of the cmdlet.

$oscName = 'MyCustSpec'

$templateName = 'MyTemplate'

$vmName = 'MyNewVM'

$folderName = 'MyFolder'

$resourcePoolName = 'MyPool'

$si = Get-View ServiceInstance

$oscMgr = Get-View -Id $si.Content.CustomizationSpecManager

$osc = $oscMgr.GetCustomizationSpec($oscName)

$Template = Get-template -Name $templateName

$folder = Get-Folder -Name $folderName

$rp = Get-ResourcePool -Name $resourcePoolName

$spec = New-Object VMware.Vim.VirtualMachineCloneSpec

$spec.Customization = $osc.Spec

$spec.Customization.Options.ChangeSID = $false

$spec.Location = New-Object VMware.Vim.VirtualMachineRelocateSpec

$spec.Location.Pool = $rp.ExtensionData.MoRef

$Template.ExtensionData.CloneVM($folder.ExtensionData.MoRef,$vmName,$spec)

And then you get the error

sid2.png

The ChangeSID option is apparently only available for Windows OS that are pre-Vista.

From Vista onwards the SID will always be changed, which is also the way the API Reference states it under CustomizationWinOptions

sid.png

Since W2K3 and WinXP are not supported anymore, this, imho, has become an obsolete parameter.

For your scenario, you could "copy" the VM instead of cloning.

See for example my HL Tools – Part 1 – Clone a VM without vCenter post.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Kovacija
Contributor
Contributor
Jump to solution

Hi,

thank you for the quick and quality informations!

I also agree that documentation need update and that cmdlet work as expected.

Nice alternative solution with cloning but we will probably modify template and let the OS Customization Specification functionality to do their job.

Regards,

Ivan

0 Kudos