VMware Cloud Community
CorinTack
Contributor
Contributor

Get-OSCustomizationSpec Hangs

I'm trying to run the script below, but it hangs at the Get-OSCustamizationSpec cmdlet. It doesn't throw any error messages, or provide any other information, it just seems to get to that cmdlet and then stop, processing it forever until I force the script to quit.

The server name and credentials are defined above this.

Anyone have any idea why this would be the case?

    Import-Module VMware.VimAutomation.HorizonView

    Import-Module VMware.VimAutomation.Core

    connect-viserver -server $hostname -credential $cred

    Get-OSCustomizationSpec "CDM Windows Workstation Customization"

    Disconnect-HVServer -Server * -Force -Confirm:$false

0 Kudos
13 Replies
LucD
Leadership
Leadership

Did you already try adding the -Verbose switch?

Does it do that for all OSCustomizationSpecs or just this one?

Anything in the vpxd log that might give more info?


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

0 Kudos
CorinTack
Contributor
Contributor

1. When running in verbose mode, the only thing that happens is it gives the following, then just hangs:

VERBOSE: 10/5/2017 12:19:57 PM Get-OSCustomizationSpec Started execution

2. This happens with all of them; if I specify a customization spec or not, as well.

3. The only thing that shows in the log that is directly related is the entry set below:

2017-10-05T12:30:54.920-05:00 info vpxd[06344] [Originator@6876 sub=vpxLro opID=5765c4c1] [VpxLRO] -- BEGIN lro-1933 -- CustomizationSpecManager -- vim.CustomizationSpecManager.get -- 5273cd69-0d77-7e14-8445-2dde7f82b099(52d04e69-b4df-eb1f-c9cf-cf063530340b)

2017-10-05T12:30:54.963-05:00 info vpxd[06344] [Originator@6876 sub=vpxLro opID=5765c4c1] [VpxLRO] -- FINISH lro-1933

0 Kudos
LucD
Leadership
Leadership

Haven't seen that behaviour before.

What happens when you create a new spec, and then try to get it?

New-OSCustomizationSpec -Name Test -OSType Windows -Type Persistent -Workgroup Workgroup -FullName fullname -OrgName orgname

Get-OSCustomizationSpec -Name Test


Which PowerCLI and vSphere version are you running this in?


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

0 Kudos
CorinTack
Contributor
Contributor

So, the script then gives the following output on the New-OSCumstomizationSpec line; it creates the spec, but then hangs before moving on to the Get-OSCustomizationSpec command.

VERBOSE: 10/5/2017 1:06:07 PM New-OSCustomizationSpec Started execution

VERBOSE: Perform operation 'Creating new OS customization spec.'.

0 Kudos
LucD
Leadership
Leadership

And which versions are you using (PowerCLI and vSphere)?


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

0 Kudos
CorinTack
Contributor
Contributor

vSphere: Version 6.5.0 Build 5318112

PowerCLI: 6.5.0-4624819

0 Kudos
LucD
Leadership
Leadership

Stupid question perhaps, did you already try stopping/starting your PowerShell/PowerCLI session?


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

0 Kudos
CorinTack
Contributor
Contributor

I have; I've even tried running this from one of our Horizon servers, and directly on the vCenter server.

0 Kudos
LucD
Leadership
Leadership

It looks as if your OSCustomizationSpec might be corrupt one way or the other.
Can you edit them from the Web Client?


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

0 Kudos
CorinTack
Contributor
Contributor

Yes, I am able to make changes via the web client and save them without issue. I'm just trying to automate some changes, and have encountered this bizarre behavior.

0 Kudos
LucD
Leadership
Leadership

One final, but drastic, suggestion, did you try restarting your VCSA?


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

0 Kudos
CorinTack
Contributor
Contributor

I have not tried anything that drastic, no, and cannot do so any time soon.

0 Kudos
LucD
Leadership
Leadership

You could launch a SR, this looks like a bug or corruption.
And PowerCLI is supported, see PowerCLI Support Breakdown


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

0 Kudos