- Google Pixel 10a – évismétlés
- Itt a Galaxy S26 széria: az Ultra fejlődött, a másik kettő alig
- Milyen okostelefont vegyek?
- Magisk
- iPhone topik
- Fotók, videók mobillal
- Redmi Note 15 Pro+ - több plusz, mint mínusz
- Brutális akkumulátort kaphat a Honor X80 GT
- Kis tárcsa kerül a nagy mellé a kameratelefonon
- Garmin Forerunner 965 - csúcs
-
Mobilarena
Sziasztok, udvozlunk mindenkit Magyarorszag legnagyobb VMware forumjaban!

Új hozzászólás Aktív témák
-
válasz
szallasi007
#4730
üzenetére
Indulásnak memóriához
$Cluster="clusterneve"
Write-Host ""
Write-Host "Checking the following cluster to balance: $Cluster"-foregroundcolor "DarkGreen"
Write-Host ""
$hostinfo = Get-Cluster $Cluster |Get-VMHost | Get-View
# Pull memory stats from each host
$hostram = @{}
$clusterram = 0
$hostinfo | % {
$hostram.Add($_.Name,$_.Summary.QuickStats.OverallMemoryUsage)
$clusterram += $_.Summary.QuickStats.OverallMemoryUsage}
$hostram.GetEnumerator() | Sort-Object Name
# Determine the delta of memory on the least loaded host
$deltahost = ($hostram.GetEnumerator() | Sort-Object Value)[0].Name
$deltaram = [Math]::Round((($clusterram / $hostinfo.Count) - ($hostram.GetEnumerator() | Sort-Object Value)[0].Value),0)
# Check if there is a host without VMs
$esx_list=Get-Cluster $Cluster|Get-VMHost
$esxWithoutVMS=0
foreach ($esx in $esx_list)
{
$vms=(get-vmhost $esx| get-vm|Where {$_.PowerState -eq "PoweredOn"}).count
Write-Host "# of VMs on $($esx): $vms" -foregroundcolor "DarkGreen"
if ($vms -eq 0)
{
$esxWithoutVMS++
}
}
if ($deltaram -lt 16384 -and $esxWithoutVMS -eq 0)
{
Write-Host ""
Write-Host "No empty hosts and/or less than 16G difference in host memory usage," -foregroundcolor "DarkGreen"
Write-Host "no need to balance, we are done. Exiting script ..." -foregroundcolor "DarkGreen"
Write-Host ""
exit 1
}
$deltamoref = (Get-VMHost -Name $deltahost).Id
Write-Host ""
Write-Host "Let me try to remediate the imbalance on:" -foregroundcolor "DarkGreen"
Write-Host "$deltahost" -foregroundcolor "DarkGreen"
Write-Host ""
# Find VMs that can fill the delta from other hosts
$vmram = @{}
Get-VM -Location (Get-Cluster $cluster) | Get-View | % {if ($_.Runtime.PowerState -match "poweredOn") {$vmram.Add($_.Name,$_.Summary.QuickStats.HostMemoryUsage)}}
# Run through VMs and migrate the smallest ones
$i = 0
$nomigration = $true
while ($nomigration){
$targetvm = ($vmram.GetEnumerator() | Sort-Object Value)[$i].Name
if (((Get-VM -Name $targetvm | Get-View).Runtime.Host) -ne $deltamoref) {
Write-Host ""
Write-Host "Moving $targetvm to $deltahost" -foregroundcolor "DarkGreen"
Write-Host ""
Move-VM -VM (Get-VM -Name $targetvm) -Destination (Get-VMHost -Name $deltahost) -VMotionPriority:High | Out-Null
$nomigration = $false
}
$i++
#catch all
if ($i -ge 100) {$nomigration = $false}
Write-Host ""
Write-Host "Finished balancing $Cluster" -foregroundcolor "DarkGreen"
Write-Host ""
}
Új hozzászólás Aktív témák
- AMD K6-III, és minden ami RETRO - Oldschool tuning
- Anime filmek és sorozatok
- exHWSW - Értünk mindenhez IS
- Milyen légkondit a lakásba?
- Világrekordot ünnepel az ASRock
- Ilyen olcsó sem volt még egy Apple notebook
- sziku69: Fűzzük össze a szavakat :)
- Luck Dragon: Asszociációs játék. :)
- Unigine Superposition Benchmark
- Multimédiás / PC-s hangfalszettek (2.0, 2.1, 5.1)
- További aktív témák...
- Játékkulcsok ! : PC Steam, EA App, Ubisoft, Windows és egyéb játékok
- Windows 10 11 Pro Office 19 21 Pro Plus Retail kulcs 1 PC Mac AKCIÓ! Automatikus 0-24
- Bitdefender Total Security 3év/3eszköz! - Tökéletes védelem.
- Microsoft és egyéb dobozos retro szoftverek
- Game Pass Ultimate előfizetések 1 - 36 hónapig azonnali kézbesítéssel a LEGOLCSÓBBAN! AKCIÓ!
- Apple iPhone 15 128GB, Kártyafüggetlen, 1 Év Garanciával
- LG 39GX90SA-W - 39" Ívelt Smart OLED/ WQHD 2K / 240Hz & 0.03ms / 1300 Nits / G-Sync & FreeSync
- AKCIÓ! Dell Precision 3571 4G LTE i7-12700H 32GB 1000GB FHD RTX A1000 4GB 1 év teljeskörű garancia
- Samsung Galaxy S23 Ultra 8/256GB - Kártyafüggetlen, Fekete - 1 Év Garanciával
- Apple iPhone 12 64GB - Kártyafüggetlen, Fekete, 91% Akku - 1 Év Garanciával
Állásajánlatok
Cég: Laptopműhely Bt.
Város: Budapest



