Quantcast
Channel: VMware Communities : All Content - VMware vCenter™
Viewing all articles
Browse latest Browse all 24426

Consolidation power cli script for vms

$
0
0

We are getting a number of consolidations needed every morning when coming in on our test environments, does anyone know the best way to setup a script to run to consolidate any vms that needed it?

 

I've tried using the below command:

 

connect-viserver VCENTERSERVER

Get-VM |

Where-Object {$_.Extensiondata.Runtime.ConsolidationNeeded} |

ForEach-Object {

  $_.ExtensionData.ConsolidateVMDisks()

}

disconnect-viserver VCENTERSERVER -confirm:$FALSE

 

with a batch file pointing at it -

 

C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe -PSConsoleFile "C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\vim.psc1" "& 'C:\Consolidation_Script\Consolidation_Script.ps1

 

I've scheduled this, but still seeing vms needing consolidation, can anyone help?


Viewing all articles
Browse latest Browse all 24426

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>