update
This commit is contained in:
@@ -1,11 +1,11 @@
|
|||||||
#!/usr/bin/env pwsh
|
#!/usr/bin/env pwsh
|
||||||
|
|
||||||
|
Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false | Out-Null
|
||||||
. /opt/idssys/powerwall/settings.ps1
|
. /opt/idssys/powerwall/settings.ps1
|
||||||
|
|
||||||
Connect-VIServer -Server $args[0] -Protocol https -User $ESXiUsername -Password $ESXiPassword | Out-Null
|
$ESXI = Connect-VIServer -Server $args[0] -Protocol https -User $ESXiUsername -Password $ESXiPassword | Out-Null
|
||||||
# Connect-VIServer -Server 10.2.1.11 -Protocol https -User $ESXiUsername -Password $ESXiPassword | Out-Null
|
|
||||||
|
|
||||||
get-vm | get-snapshot | where {($_.vm -notlike '*_replica')} | select vm, name, description, created, sizegb
|
get-vm | get-snapshot | where {($_.vm -notlike '*_replica')} | select vm, name, description, created, sizegb
|
||||||
# get-vm | get-snapshot | where {($_.vm -notlike '*_replica')} | select vm, name, description, created, sizegb | ConvertTo-Json -Depth 1 -WarningAction:SilentlyContinue
|
# get-vm | get-snapshot | where {($_.vm -notlike '*_replica')} | select vm, name, description, created, sizegb | ConvertTo-Json -Depth 1 -WarningAction:SilentlyContinue
|
||||||
|
|
||||||
exit 0
|
Disconnect-VIServer $ESXI -Confirm:$false
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
#!/usr/bin/env pwsh
|
#!/usr/bin/env pwsh
|
||||||
|
|
||||||
|
Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false | Out-Null
|
||||||
. /opt/idssys/powerwall/settings.ps1
|
. /opt/idssys/powerwall/settings.ps1
|
||||||
|
|
||||||
Connect-VIServer -Server $VCENTERHOST -Protocol https -User $VCENTERUSER -Password $VCENTERPASS | Out-Null
|
$ESXI = Connect-VIServer -Server $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
|
||||||
|
|
||||||
exit 0
|
Disconnect-VIServer $ESXI -Confirm:$false
|
||||||
|
|||||||
@@ -1,16 +1,30 @@
|
|||||||
#!/usr/bin/env pwsh
|
#!/usr/bin/env pwsh
|
||||||
|
|
||||||
# Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false
|
Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false | Out-Null
|
||||||
. /opt/idssys/powerwall/settings.ps1
|
. /opt/idssys/powerwall/settings.ps1
|
||||||
|
|
||||||
$ESXI = Connect-VIServer -Server $args[0] -Protocol https -User $ESXiUsername -Password $ESXiPassword | Out-Null
|
$ESXI = Connect-VIServer -Server $args[0] -Protocol https -User $ESXiUsername -Password $ESXiPassword
|
||||||
|
|
||||||
$VMLIST = Get-Datastore | Where {$_.Name -like '*iSCSI-*'} | Get-VM
|
Do {
|
||||||
|
$VMLIST = Get-Datastore | Where {$_.Name -like '*iSCSI-*'} | Get-VM
|
||||||
|
write-host $VMLIST
|
||||||
|
if ($VMLIST -ne $null) {
|
||||||
|
write-host "cycling through iscsi vms found"
|
||||||
|
$poff = 'no'
|
||||||
|
Foreach ($VM in $VMLIST) {
|
||||||
|
$VMI = Get-VM $VM
|
||||||
|
if ($VMI -eq $null -Or $VMI.PowerState -match 'PoweredOn') {
|
||||||
|
$poff = 'no'
|
||||||
|
break
|
||||||
|
} else {
|
||||||
|
$poff = 'yes'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
write-host "no iscsi vms found"
|
||||||
|
$poff = 'yes'
|
||||||
|
}
|
||||||
|
} Until ($poff -match 'yes')
|
||||||
|
|
||||||
Foreach ($VM in $VMLIST) {
|
|
||||||
while((Get-VM $VM).PowerState -ne 'PoweredOff') {
|
|
||||||
Start-Sleep -Seconds 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Disconnect-VIServer $ESXI -Confirm:$false
|
Disconnect-VIServer $ESXI -Confirm:$false
|
||||||
@@ -1,9 +1,10 @@
|
|||||||
#!/usr/bin/env pwsh
|
#!/usr/bin/env pwsh
|
||||||
|
|
||||||
|
Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false | Out-Null
|
||||||
. /opt/idssys/powerwall/settings.ps1
|
. /opt/idssys/powerwall/settings.ps1
|
||||||
|
|
||||||
Connect-VIServer -Server $args[0] -Protocol https -User $ESXiUsername -Password $ESXiPassword | Out-Null
|
$ESXI = Connect-VIServer -Server $args[0] -Protocol https -User $ESXiUsername -Password $ESXiPassword | Out-Null
|
||||||
|
|
||||||
Get-Datastore | Where {$_.Name -like '*iSCSI-*'} | Get-VM | Where {$_.PowerState -like '*On*' -and $_.Name -notlike '*CLS*'} | Shutdown-VMGuest -Confirm:$false
|
Get-Datastore | Where {$_.Name -like '*iSCSI-*'} | Get-VM | Where {$_.PowerState -like '*On*' -and $_.Name -notlike '*CLS*'} | Shutdown-VMGuest -Confirm:$false
|
||||||
|
|
||||||
exit 0
|
Disconnect-VIServer $ESXI -Confirm:$false
|
||||||
@@ -1,9 +1,10 @@
|
|||||||
#!/usr/bin/env pwsh
|
#!/usr/bin/env pwsh
|
||||||
|
|
||||||
|
Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false | Out-Null
|
||||||
. /opt/idssys/powerwall/settings.ps1
|
. /opt/idssys/powerwall/settings.ps1
|
||||||
|
|
||||||
Connect-VIServer -Server $args[0] -Protocol https -User $ESXiUsername -Password $ESXiPassword | Out-Null
|
$ESXI = 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
|
||||||
|
|
||||||
exit 0
|
Disconnect-VIServer $ESXI -Confirm:$false
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
#!/usr/bin/env pwsh
|
|
||||||
|
|
||||||
. /opt/idssys/powerwall/settings.ps1
|
|
||||||
|
|
||||||
Connect-VIServer -Server $args[0] -Protocol https -User $ESXiUsername -Password $ESXiPassword | Out-Null
|
|
||||||
|
|
||||||
Get-VM | Where {$_.Name -like '*iSCSI-Systems*'} | Shutdown-VMGuest -Confirm:$false
|
|
||||||
|
|
||||||
exit 0
|
|
||||||
@@ -27,7 +27,4 @@ Do {
|
|||||||
} Until ($poff -match 'yes')
|
} Until ($poff -match 'yes')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Disconnect-VIServer $ESXI -Confirm:$false
|
Disconnect-VIServer $ESXI -Confirm:$false
|
||||||
@@ -1,9 +1,10 @@
|
|||||||
#!/usr/bin/env pwsh
|
#!/usr/bin/env pwsh
|
||||||
|
|
||||||
|
Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false | Out-Null
|
||||||
. /opt/idssys/powerwall/settings.ps1
|
. /opt/idssys/powerwall/settings.ps1
|
||||||
|
|
||||||
Connect-VIServer -Server $args[0] -Protocol https -User $ESXiUsername -Password $ESXiPassword | Out-Null
|
$ESXI = Connect-VIServer -Server $args[0] -Protocol https -User $ESXiUsername -Password $ESXiPassword | Out-Null
|
||||||
|
|
||||||
Get-Datastore | Where {$_.Name -like '*iSCSI-SYS*'} | Get-VM | Where {$_.PowerState -like '*On*' -and $_.Name -notlike '*CLS*'} | Shutdown-VMGuest -Confirm:$false
|
Get-Datastore | Where {$_.Name -like '*iSCSI-SYS*'} | Get-VM | Where {$_.PowerState -like '*On*' -and $_.Name -notlike '*CLS*'} | Shutdown-VMGuest -Confirm:$false
|
||||||
|
|
||||||
exit 0
|
Disconnect-VIServer $ESXI -Confirm:$false
|
||||||
@@ -1,16 +1,30 @@
|
|||||||
#!/usr/bin/env pwsh
|
#!/usr/bin/env pwsh
|
||||||
|
|
||||||
# Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false
|
Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false | Out-Null
|
||||||
. /opt/idssys/powerwall/settings.ps1
|
. /opt/idssys/powerwall/settings.ps1
|
||||||
|
|
||||||
$ESXI = Connect-VIServer -Server $args[0] -Protocol https -User $ESXiUsername -Password $ESXiPassword | Out-Null
|
$ESXI = Connect-VIServer -Server $args[0] -Protocol https -User $ESXiUsername -Password $ESXiPassword
|
||||||
|
|
||||||
$VMLIST = Get-Datastore | Where {$_.Name -like '*iSCSI-PRI*'} | Get-VM
|
Do {
|
||||||
|
$VMLIST = Get-Datastore | Where {$_.Name -like '*iSCSI-PRI*'} | Get-VM
|
||||||
|
write-host $VMLIST
|
||||||
|
if ($VMLIST -ne $null) {
|
||||||
|
write-host "cycling through iscsi vms found"
|
||||||
|
$poff = 'no'
|
||||||
|
Foreach ($VM in $VMLIST) {
|
||||||
|
$VMI = Get-VM $VM
|
||||||
|
if ($VMI -eq $null -Or $VMI.PowerState -match 'PoweredOn') {
|
||||||
|
$poff = 'no'
|
||||||
|
break
|
||||||
|
} else {
|
||||||
|
$poff = 'yes'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
write-host "no iscsi vms found"
|
||||||
|
$poff = 'yes'
|
||||||
|
}
|
||||||
|
} Until ($poff -match 'yes')
|
||||||
|
|
||||||
Foreach ($VM in $VMLIST) {
|
|
||||||
while((Get-VM $VM).PowerState -ne 'PoweredOff') {
|
|
||||||
Start-Sleep -Seconds 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Disconnect-VIServer $ESXI -Confirm:$false
|
Disconnect-VIServer $ESXI -Confirm:$false
|
||||||
@@ -1,9 +1,10 @@
|
|||||||
#!/usr/bin/env pwsh
|
#!/usr/bin/env pwsh
|
||||||
|
|
||||||
|
Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false | Out-Null
|
||||||
. /opt/idssys/powerwall/settings.ps1
|
. /opt/idssys/powerwall/settings.ps1
|
||||||
|
|
||||||
Connect-VIServer -Server $args[0] -Protocol https -User $ESXiUsername -Password $ESXiPassword | Out-Null
|
$ESXI = Connect-VIServer -Server $args[0] -Protocol https -User $ESXiUsername -Password $ESXiPassword | Out-Null
|
||||||
|
|
||||||
Get-Datastore | Where {$_.Name -like '*iSCSI-PRI*'} | Get-VM | Where {$_.PowerState -like '*On*' -and $_.Name -notlike '*CLS*'} | Shutdown-VMGuest -Confirm:$false
|
Get-Datastore | Where {$_.Name -like '*iSCSI-PRI*'} | Get-VM | Where {$_.PowerState -like '*On*' -and $_.Name -notlike '*CLS*'} | Shutdown-VMGuest -Confirm:$false
|
||||||
|
|
||||||
exit 0
|
Disconnect-VIServer $ESXI -Confirm:$false
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
#!/usr/bin/env pwsh
|
#!/usr/bin/env pwsh
|
||||||
|
|
||||||
|
Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false | Out-Null
|
||||||
. /opt/idssys/powerwall/settings.ps1
|
. /opt/idssys/powerwall/settings.ps1
|
||||||
|
|
||||||
Connect-VIServer -Server $args[0] -Protocol https -User $ESXiUsername -Password $ESXiPassword | Out-Null
|
$ESXI = Connect-VIServer -Server $args[0] -Protocol https -User $ESXiUsername -Password $ESXiPassword | Out-Null
|
||||||
|
|
||||||
Get-VM | Where {$_.PowerState -like '*On*' -and ($_.Name -like '*MySQL-Node*' -or $_.Name -like '*LAN-DNS*')} | Suspend-VM -Confirm:$false
|
Get-VM | Where {$_.PowerState -like '*On*' -and ($_.Name -like '*MySQL-Node*' -or $_.Name -like '*LAN-DNS*')} | Suspend-VM -Confirm:$false
|
||||||
|
|
||||||
exit 0
|
Disconnect-VIServer $ESXI -Confirm:$false
|
||||||
|
|||||||
@@ -1,16 +1,30 @@
|
|||||||
#!/usr/bin/env pwsh
|
#!/usr/bin/env pwsh
|
||||||
|
|
||||||
# Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false
|
Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false | Out-Null
|
||||||
. /opt/idssys/powerwall/settings.ps1
|
. /opt/idssys/powerwall/settings.ps1
|
||||||
|
|
||||||
$ESXI = Connect-VIServer -Server $args[0] -Protocol https -User $ESXiUsername -Password $ESXiPassword | Out-Null
|
$ESXI = Connect-VIServer -Server $args[0] -Protocol https -User $ESXiUsername -Password $ESXiPassword
|
||||||
|
|
||||||
$VMLIST = Get-VM | Where {$_.PowerState -like '*On*' -and $_.Name -notlike '*CLS*' -and $_.Name -notlike '*iSCSI*'}
|
Do {
|
||||||
|
$VMLIST = Get-VM | Where {$_.PowerState -like '*On*' -and $_.Name -notlike '*CLS*' -and $_.Name -notlike '*iSCSI*'}
|
||||||
|
write-host $VMLIST
|
||||||
|
if ($VMLIST -ne $null) {
|
||||||
|
write-host "cycling through iscsi vms found"
|
||||||
|
$poff = 'no'
|
||||||
|
Foreach ($VM in $VMLIST) {
|
||||||
|
$VMI = Get-VM $VM
|
||||||
|
if ($VMI -eq $null -Or $VMI.PowerState -match 'PoweredOn') {
|
||||||
|
$poff = 'no'
|
||||||
|
break
|
||||||
|
} else {
|
||||||
|
$poff = 'yes'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
write-host "no iscsi vms found"
|
||||||
|
$poff = 'yes'
|
||||||
|
}
|
||||||
|
} Until ($poff -match 'yes')
|
||||||
|
|
||||||
Foreach ($VM in $VMLIST) {
|
|
||||||
while((Get-VM $VM).PowerState -ne 'PoweredOff') {
|
|
||||||
Start-Sleep -Seconds 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Disconnect-VIServer $ESXI -Confirm:$false
|
Disconnect-VIServer $ESXI -Confirm:$false
|
||||||
@@ -1,9 +1,10 @@
|
|||||||
#!/usr/bin/env pwsh
|
#!/usr/bin/env pwsh
|
||||||
|
|
||||||
|
Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false | Out-Null
|
||||||
. /opt/idssys/powerwall/settings.ps1
|
. /opt/idssys/powerwall/settings.ps1
|
||||||
|
|
||||||
Connect-VIServer -Server $args[0] -Protocol https -User $ESXiUsername -Password $ESXiPassword | Out-Null
|
$ESXI = 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
|
||||||
|
|
||||||
exit 0
|
Disconnect-VIServer $ESXI -Confirm:$false
|
||||||
Reference in New Issue
Block a user