update
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
. /opt/idssys/powerwall/settings.ps1
|
. /opt/idssys/powerwall/settings.ps1
|
||||||
|
|
||||||
Connect-VIServer -Server $args[0] -Protocol https -User $ESXiUsername -Password $ESXiPassword
|
Connect-VIServer -Server $args[0] -Protocol https -User $ESXiUsername -Password $ESXiPassword | Out-Null
|
||||||
|
|
||||||
get-vm | get-snapshot | select vm, name, description, created, sizegb
|
get-vm | get-snapshot | select vm, name, description, created, sizegb
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,6 @@
|
|||||||
|
|
||||||
. /opt/idssys/powerwall/settings.ps1
|
. /opt/idssys/powerwall/settings.ps1
|
||||||
|
|
||||||
Connect-VIServer -Server $PW_VCENTERHOST -Protocol https -User $VCENTERUSER -Password $VCENTERPASS
|
Connect-VIServer -Server $PW_VCENTERHOST -Protocol https -User $VCENTERUSER -Password $VCENTERPASS | Out-Null
|
||||||
|
|
||||||
Get-VMHost -Name $args[0] | set-vmhost -State Maintenance
|
Get-VMHost -Name $args[0] | set-vmhost -State Maintenance
|
||||||
|
|||||||
@@ -2,6 +2,6 @@
|
|||||||
|
|
||||||
. /opt/idssys/powerwall/settings.ps1
|
. /opt/idssys/powerwall/settings.ps1
|
||||||
|
|
||||||
Connect-VIServer -Server $args[0] -Protocol https -User $ESXiUsername -Password $ESXiPassword
|
Connect-VIServer -Server $args[0] -Protocol https -User $ESXiUsername -Password $ESXiPassword | Out-Null
|
||||||
|
|
||||||
Get-VM | Where {$_.Name -like '*iSCSI*'} | Shutdown-VMGuest -Confirm:$false
|
Get-VM | Where {$_.Name -like '*iSCSI*'} | Shutdown-VMGuest -Confirm:$false
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
. /opt/idssys/powerwall/settings.ps1
|
. /opt/idssys/powerwall/settings.ps1
|
||||||
|
|
||||||
Connect-VIServer -Server $args[0] -Protocol https -User $ESXiUsername -Password $ESXiPassword
|
Connect-VIServer -Server $args[0] -Protocol https -User $ESXiUsername -Password $ESXiPassword | Out-Null
|
||||||
|
|
||||||
Get-Datastore | Where {$_.Name -like '*iSCSI1*' -or $_.Name -like '*iSCSI2*'} | Get-VM | if ($_.PowerState -eq "PoweredOn") {
|
Get-Datastore | Where {$_.Name -like '*iSCSI1*' -or $_.Name -like '*iSCSI2*'} | Get-VM | if ($_.PowerState -eq "PoweredOn") {
|
||||||
Try{
|
Try{
|
||||||
|
|||||||
@@ -2,6 +2,6 @@
|
|||||||
|
|
||||||
. /opt/idssys/powerwall/settings.ps1
|
. /opt/idssys/powerwall/settings.ps1
|
||||||
|
|
||||||
Connect-VIServer -Server $args[0] -Protocol https -User $ESXiUsername -Password $ESXiPassword
|
Connect-VIServer -Server $args[0] -Protocol https -User $ESXiUsername -Password $ESXiPassword | Out-Null
|
||||||
|
|
||||||
Get-Datastore | Where {$_.Name -like '*iSCSI1*' -or $_.Name -like '*iSCSI2*'} | Get-VM | Where {$_.PowerState -like '*On*' -and $_.Name -notlike '*CLS*'} | Shutdown-VMGuest -Confirm:$false
|
Get-Datastore | Where {$_.Name -like '*iSCSI1*' -or $_.Name -like '*iSCSI2*'} | Get-VM | Where {$_.PowerState -like '*On*' -and $_.Name -notlike '*CLS*'} | Shutdown-VMGuest -Confirm:$false
|
||||||
|
|||||||
@@ -2,6 +2,6 @@
|
|||||||
|
|
||||||
. /opt/idssys/powerwall/settings.ps1
|
. /opt/idssys/powerwall/settings.ps1
|
||||||
|
|
||||||
Connect-VIServer -Server $args[0] -Protocol https -User $ESXiUsername -Password $ESXiPassword
|
Connect-VIServer -Server $args[0] -Protocol https -User $ESXiUsername -Password $ESXiPassword | Out-Null
|
||||||
|
|
||||||
Get-VM | Where {$_.PowerState -like '*On*' -and ($_.Name -like '*MySQL*' -or $_.Name -like '*PiHole*' -or $_.Name -like '*vCenter*')} | Suspend-VM -Confirm:$false
|
Get-VM | Where {$_.PowerState -like '*On*' -and ($_.Name -like '*MySQL*' -or $_.Name -like '*PiHole*' -or $_.Name -like '*vCenter*')} | Suspend-VM -Confirm:$false
|
||||||
|
|||||||
@@ -2,6 +2,6 @@
|
|||||||
|
|
||||||
. /opt/idssys/powerwall/settings.ps1
|
. /opt/idssys/powerwall/settings.ps1
|
||||||
|
|
||||||
Connect-VIServer -Server $args[0] -Protocol https -User $ESXiUsername -Password $ESXiPassword
|
Connect-VIServer -Server $args[0] -Protocol https -User $ESXiUsername -Password $ESXiPassword | Out-Null
|
||||||
|
|
||||||
Get-VM | Where {$_.PowerState -like '*On*' -and $_.Name -notlike '*CLS*' -and $_.Name -notlike '*iSCSI*'} | Shutdown-VMGuest -Confirm:$false
|
Get-VM | Where {$_.PowerState -like '*On*' -and $_.Name -notlike '*CLS*' -and $_.Name -notlike '*iSCSI*'} | Shutdown-VMGuest -Confirm:$false
|
||||||
|
|||||||
Reference in New Issue
Block a user