Hi community,
Can anyone provide me with a PowerCLI script which will identify Guest VMs within vCenter which have Hot-Add, Hot-Plug enabled? We've recently migrated a group of Linux VMs (RHEL 6) into a new vCenter Server and enabled feature, but have come across one where Hot-Plug was missed!! Just want to ensure there are not others we've missed too.
Thanks in advance.
Check out Arne's post PowerCLI: Check CPU/Memory Hot Add
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Check out Arne's post PowerCLI: Check CPU/Memory Hot Add
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
LucD, you're the dogs bollocks!!! :smileycool:
Thanks (after consulting the Urban Dictionary) :smileygrin:
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Haa-haa.. No worries.
Just one other thing? How would I incorporate desired operating system to run below script against, in this case Red hat 6?
Get-VM | Get-View | Select Name, `
@{N="CpuHotAddEnabled";E={$_.Config.CpuHotAddEnabled}}, `
@{N="CpuHotRemoveEnabled";E={$_.Config.CpuHotRemoveEnabled}}, `
@{N="MemoryHotAddEnabled";E={$_.Config.MemoryHotAddEnabled}} |
This is the only reliable RHEL version in production that fully supports Hot-add, Hot-plug.
Thanks in advance.
Do you mean to filter on only VMs with that guest OS?
Assuming you have VMware Tools installed on all VMs, you can do the following.
Note I used the Get-View directly, should be a bit faster.
Get-View -ViewType VirtualMachine -Filter @{'Guest.GuestFullName'="^Red Hat Enterprise Linux 6"} |
Select Name, `
@{N='OS';E={$_.Guest.GuestFullName}},
@{N="CpuHotAddEnabled";E={$_.Config.CpuHotAddEnabled}},
@{N="CpuHotRemoveEnabled";E={$_.Config.CpuHotRemoveEnabled}},
@{N="MemoryHotAddEnabled";E={$_.Config.MemoryHotAddEnabled}}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Magic!! That did the trick!!
Many thanks as always LucD.