Hirdetés
- arabus: 256GB-os DDR5 memóriamodul 5700 USD.
- GoodSpeed: Te hány éves vagy?
- MasterDeeJay: Érdekesség: 16GB-os DDR3 sodimm modul asztali gépben
- bambano: Bambanő háza tája
- Luck Dragon: Asszociációs játék. :)
- Sapphi: StremHU | Source – Self-hostolható Stremio addon magyar trackerekhez
- sziku69: Szólánc.
- D1Rect: Nagy "hülyétkapokazapróktól" topik
- eBay-es kütyük kis pénzért
- sziku69: Fűzzük össze a szavakat :)
-
LOGOUT
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
- One otthoni szolgáltatások (TV, internet, telefon)
- Sorozatok
- Bittorrent topik
- Raspberry Pi
- NVIDIA GeForce RTX 5070 / 5070 Ti (GB205 / 203)
- BIOS topic
- OFF TOPIC 44 - Te mondd, hogy offtopic, a te hangod mélyebb!
- Apple iPhone 17 Pro Max – fennsík
- Milyen routert?
- Shield TV-t csinált a Shieldből az NVIDIA
- További aktív témák...
- Windows 10/11 Home/Pro , Office 2024 kulcsok
- Game Pass Ultimate előfizetések 1 - 36 hónapig azonnali kézbesítéssel a LEGOLCSÓBBAN! AKCIÓ!
- Játékkulcsok ! : PC Steam, EA App, Ubisoft, Windows és egyéb játékok : (12.20.)
- Windows, Office licencek kedvező áron, egyenesen a Microsoft-tól - Automata kézbesítés utalással is!
- Humble szökevények 500-2500Ft
- 173 - Lenovo Legion Pro 7 (16IAX10H) - Intel Core U9 275HX, RTX 5080 (ELKELT)
- Tablet felvásárlás!! Apple iPad, iPad Mini, iPad Air, iPad Pro
- Apple iPad 10th Wi-Fi + Cellular - Silver - 64GB - BONTATLAN - ÚJ
- Keresünk Galaxy S23/S23+/S23 Ultra/S23 Fe
- Microsoft Surface Pro 7+ - Újszerű, billentyűzettel és ceruzával
Állásajánlatok
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest
Cég: Laptopszaki Kft.
Város: Budapest


