- Intel Core i5 / i7 / i9 "Alder Lake-Raptor Lake/Refresh" (LGA1700)
- Kötelező frissítésnek számít a Microsoft legújabb csomagja a Windows 11-hez
- Apple MacBook
- AMD K6-III, és minden ami RETRO - Oldschool tuning
- Vezetékes FEJhallgatók
- Milyen asztali (teljes vagy fél-) gépet vegyek?
- Csalásnak ítéli az új Red Magic csúcstelefonok működését a 3DMark
- Nem indul és mi a baja a gépemnek topik
- ThinkPad (NEM IdeaPad)
- Ami Kínában OnePlus Pad Pro, az errefelé mégis csak Pad 2 lett
-
PROHARDVER!
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
- Kertészet, mezőgazdaság topik
- Intel Core i5 / i7 / i9 "Alder Lake-Raptor Lake/Refresh" (LGA1700)
- Battlefield 6
- Mobil flották
- Okos otthon - Home Assistant, openHAB és más nyílt rendszerek
- Xiaomi 14 Ultra - Leica hercegnő
- Tesla topik
- Revolut
- Kötelező frissítésnek számít a Microsoft legújabb csomagja a Windows 11-hez
- Apple MacBook
- További aktív témák...
- Microsoft és egyéb dobozos retro szoftverek
- Vírusirtó, Antivirus, VPN kulcsok GARANCIÁVAL!
- Microsoft Office 2024 Home Business dobozos
- Windows, Office licencek kedvező áron, egyenesen a Microsoft-tól - Automata kézbesítés utalással is!
- Game Pass Ultimate előfizetések 3 - 36 hónapig azonnali kézbesítéssel a LEGOLCSÓBBAN! AKCIÓ!
- Apple iPhone 15 Pro Max Blue Titanium 512GB használt karcmentes 100% akku 6 hónap garancia
- Asus Tuf RTX 5070 // Felbontott, új // SZÁMLA // GARANCIA //
- Motorola Edge 40 / 8/256GB / Kártyafüggetlen / 12Hó Garancia
- Telefon felvásárlás!! iPhone 12 Mini/iPhone 12/iPhone 12 Pro/iPhone 12 Pro Max
- Egérpadok, billentyűsapkák(keycapek), csuklótámaszok /ARCANE/DUCKY/GLORIOUS/
Állásajánlatok
Cég: Laptopműhely Bt.
Város: Budapest


