Automation

 View Only
  • 1.  CPU Topology - Assigned at power on

    Posted Feb 06, 2024 01:37 AM

    Hi,

    In vSphere 8, using the GUI to create a VM defaults to "Assigned at power on" for CPU Topology.

    I've been using powercli's (version 13.1) New-VM with -NumCpu but this configures the VM with "Manual" for CPU Topology.  Using the same integer with -NumCpu and -CoresPerSocket still creates the VM as "Manual" for CPU Topology.

    Is there any option with powercli to create the VM with "Assigned at power on" for CPU Topology?

    Thanks.

     

     



  • 2.  RE: CPU Topology - Assigned at power on

    Posted Feb 06, 2024 07:03 AM

    Afaik, not with the current version



  • 3.  RE: CPU Topology - Assigned at power on

    Posted Feb 06, 2024 07:18 AM

    Bummer ... but thanks for the update.



  • 4.  RE: CPU Topology - Assigned at power on

    Posted 23 days ago

    You can't do it with the New-VM cmdlet, but you can change the setting after the VM has been created.

    $vmName = 'MyVM'
    
    $vm = Get-VM -Name $vmName
    $spec = New-Object VMware.Vim.VirtualMachineConfigSpec
    $spec.NumCoresPerSocket = 0
    $vm.ExtensionData.ReConfigVM($spec)
    
    


    ------------------------------


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


    ------------------------------



  • 5.  RE: CPU Topology - Assigned at power on

    Posted 23 days ago

    Hi, 
    can you determine from a vm with powercli whether the CPU topology is "Assigned at power on" or not?




  • 6.  RE: CPU Topology - Assigned at power on

    Posted 23 days ago

    Yes, if the AutoCoresPerSocket property is set to $true

    Get-VM |
    Select Name,
        @{N='autoCoresPerSocket';E={$_.ExtensionData.Config.Hardware.AutoCoresPerSocket}}


    ------------------------------


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


    ------------------------------



  • 7.  RE: CPU Topology - Assigned at power on

    Posted 23 days ago

    Thanks for the quick response.




  • 8.  RE: CPU Topology - Assigned at power on

    Posted 23 days ago

    Hey there!

    It seems like you're running into a quirk with PowerCLI when setting the CPU topology. Unfortunately, as of now, PowerCLI defaults to "Manual" for CPU topology when specifying CPU options like -NumCpu and -CoresPerSocket. There isn't a built-in parameter to force "Assigned at power on" during VM creation via PowerCLI.

    A possible workaround is to create the VM first, then use the Set-VM cmdlet after the fact to modify the topology settings or use the vSphere Client GUI to adjust it manually post-creation. Hopefully, a future version of PowerCLI might address this gap!

    Cheers!




  • 9.  RE: CPU Topology - Assigned at power on

    Posted 23 days ago

    Did you even read the replies in this thread?



    ------------------------------


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


    ------------------------------