# Add the PowerCLI snapin
Write-Host "Adding PowerCLI Snapin" -ForegroundColor Green
Add-PsSnapin vmware.vimautomation.core
####Set VM RAM to 3500
#############################################
# Inputs
$clusterObj = Get-Cluster -Name 'XenDesktop'
$vmPrefix = 'PCDCW732'
# Create VM cust spec
$spec = New-Object VMware.Vim.VirtualMachineConfigSpec
$spec.MemoryMB = 3072
# Get VM Objects
$vms = $clusterObj | Get-VM | where {$_.Name -match $vmPrefix}
# Perform reconfiguration
$vms | %{
$currentVM = $_
($currentVM).ExtensionData.ReconfigVM_Task($spec)
}
###VM reservation
########################
# Inputs
$clusterObj = Get-Cluster -Name 'XenDesktop'
$vmPrefix = 'PCDCW732'
# Create VM cust spec
$spec = New-Object VMware.Vim.VirtualMachineConfigSpec
$spec.memoryReservationLockedToMax = $true
# Get VM Objects
$vms = $clusterObj | Get-VM | where {$_.Name -match $vmPrefix}
# Perform reconfiguration
$vms | %{
$currentVM = $_
($currentVM).ExtensionData.ReconfigVM_Task($spec)
}
Write-Host "Adding PowerCLI Snapin" -ForegroundColor Green
Add-PsSnapin vmware.vimautomation.core
####Set VM RAM to 3500
#############################################
# Inputs
$clusterObj = Get-Cluster -Name 'XenDesktop'
$vmPrefix = 'PCDCW732'
# Create VM cust spec
$spec = New-Object VMware.Vim.VirtualMachineConfigSpec
$spec.MemoryMB = 3072
# Get VM Objects
$vms = $clusterObj | Get-VM | where {$_.Name -match $vmPrefix}
# Perform reconfiguration
$vms | %{
$currentVM = $_
($currentVM).ExtensionData.ReconfigVM_Task($spec)
}
###VM reservation
########################
# Inputs
$clusterObj = Get-Cluster -Name 'XenDesktop'
$vmPrefix = 'PCDCW732'
# Create VM cust spec
$spec = New-Object VMware.Vim.VirtualMachineConfigSpec
$spec.memoryReservationLockedToMax = $true
# Get VM Objects
$vms = $clusterObj | Get-VM | where {$_.Name -match $vmPrefix}
# Perform reconfiguration
$vms | %{
$currentVM = $_
($currentVM).ExtensionData.ReconfigVM_Task($spec)
}
No comments:
Post a Comment