NucleusVM
Enthusiast
Enthusiast

customization specification set timezone linux

I am creating a new customization specification using this command:
New-OSCustomizationSpec -OSType Linux -Name "lnx_spec_tmp" -Domain "domain.name" -DnsSuffix "dns.suffix" -DnsServer $dns

This works great, but doesn't set the timezone. So I change it to this:
New-OSCustomizationSpec -OSType Linux -Name "lnx_spec_tmp" -Domain "domain.name" -DnsSuffix "dns.suffix" -DnsServer $dns -TimeZone 130

Now, when I run it, I get a prompt for "Fullname", so I change it to this:
New-OSCustomizationSpec -OSType Linux -Name "lnx_spec_tmp" -Domain "domain.name" -DnsSuffix "dns.suffix" -DnsServer $dns -TimeZone 130 -FullName "fullnamehere"

Now, when I run it, I get a prompt for "OrgName", so I change it to this:
New-OSCustomizationSpec -OSType Linux -Name "lnx_spec_tmp" -Domain "domain.name" -DnsSuffix "dns.suffix" -DnsServer $dns -TimeZone 130 -FullName "fullnamehere" -OrgName "orgnamehere"

And now I get the error:
New-OSCustomizationSpec : 06/07/2017 18:30:06    New-OSCustomizationSpec        You must specify only parameters that belong to the same parameter set, Windows or Linux.   
At line:1 char:1
+ New-OSCustomizationSpec -OSType Linux -Name "lnx_spec_tmp" -Domain "domain.name" ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [New-OSCustomizationSpec], InvalidArgument
    + FullyQualifiedErrorId : Core_NewCustomizationSpec_DoWork_WrongParameterSet,VMware.VimAutomation.ViCore.Cmdlets.Commands.NewCustomizationSpec

What I'm I doing wrong here?

0 Kudos
7 Replies
LucD
Leadership
Leadership

Seems to be working ok for me.

oscustlinux.png

Which PowerCLI version are you using (do a Get-PowerCLIVersion).

PS: part of your code was cut off, I can't see each line of code to the end.


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

0 Kudos
NucleusVM
Enthusiast
Enthusiast

I am using powercli version 6.0 release 1 build 2548067

I edited the original post to make it appear better.

0 Kudos
LucD
Leadership
Leadership

Can you eventually upgrade to PowerCLI 6.5.1, and check if that makes a difference?


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

0 Kudos
FernGO
Contributor
Contributor

Hello,

I'm having the same issue and I believe it's due to the fact that -timezone doesn't work for Linux deployments.

pastedImage_1.png

I'm using the latest powercli version.

Maybe someone can confirm this.

Thanks

0 Kudos
LucD
Leadership
Leadership

That is correct, see also the text on the TimeZone parameter on the Set-OsCustomizationSpec cmdlet.

It clearly states "Specifies the name or ID of the time zone for a Windows guest OS only."


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

0 Kudos
FernGO
Contributor
Contributor

Thanks Luc,

It seems that this "Windows guest OS" comment has been included in the latest version(s) of the documentation, but not in previous ones:

pastedImage_1.png

Set-OSCustomizationSpec - vSphere PowerCLI Cmdlets Reference

Thanks again

0 Kudos
LucD
Leadership
Leadership

That is correct.


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

0 Kudos