VMware Cloud Community
Gaetan123
Enthusiast
Enthusiast
Jump to solution

Error enabling CPU hotadd and Mem hotplug

I am trying to enable CPU and Mem hotplug on a newly deployed VM and I am getting the following error. It's powered off

PS C:\WINDOWS\system32> $VM="DEV999-test"
PS C:\WINDOWS\system32> $spec = New-Object VMware.Vim.VirtualMachineConfigSpec
$spec.CpuHotAddEnabled = $true
$spec.MemoryHotAddEnabled = $true
$VM.ExtensionData.ReconfigVM($spec)

You cannot call a method on a null-valued expression.
At line:4 char:1
+ $VM.ExtensionData.ReconfigVM($spec)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull

PS C:\WINDOWS\system32>
PS C:\WINDOWS\system32>
PS C:\WINDOWS\system32>
PS C:\WINDOWS\system32>
PS C:\WINDOWS\system32> Get-PowerCLIVersion
WARNING: The cmdlet "Get-PowerCLIVersion" is deprecated. Please use the 'Get-Module' cmdlet instead.

PowerCLI Version
----------------
VMware PowerCLI 12.2.0 build 17538434
---------------
Component Versions
---------------
VMware Common PowerCLI Component 12.3 build 17838947
VMware Cis Core PowerCLI Component PowerCLI Component 12.3 build 17839331
VMware VimAutomation VICore Commands PowerCLI Component PowerCLI Component 12.3 build 17839688

 

What am I doing wrong ?

Thks
Gaetan

Reply
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

You can't use the OBN feature when calling vSphere API.
Change the 1st command to

 

$VM = Get-VM -Name "DEV999-test"

 


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

View solution in original post

2 Replies
LucD
Leadership
Leadership
Jump to solution

You can't use the OBN feature when calling vSphere API.
Change the 1st command to

 

$VM = Get-VM -Name "DEV999-test"

 


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

Gaetan123
Enthusiast
Enthusiast
Jump to solution

LucD, you are a star !!

Reply
0 Kudos