The Latest Gartner® Magic Quadrant™Hyperconverged Infrastructure Software
Code: Select all
param($addr="172.22.22.38", $port=3261, $user="root", $password="starwind", $deviceName="havolume1")
Import-Module StarWindX
Code: Select all
Import-Module StarWindX
$server = New-SWServer -host 172.22.22.38 -port 3261 -user root -password starwind
$server.Connect()
$server.Devices | Format-Table Name, TargetName
$server.Disconnect()
.\StatusNode1.ps1
Name TargetName
---- ----------
HAImage1 iqn.2008-08.com.starwindsoftware:172.22.22.38-starwind-vsan01
imagefile1 empty
Code: Select all
param($addr="172.22.22.38", $port=3261, $user="root", $password="starwind", $deviceName="iqn.2008-08.com.starwindsoftware:172.22.22.38-starwind-vsan01")
Import-Module StarWindX
try
{
Enable-SWXLog
$server = New-SWServer $addr $port $user $password
$server.Connect()
$device = Get-Device $server -name $deviceName
if( !$device )
{
Write-Host "Device not found" -foreground red
return
}
if($device.MaintenanceMode -ne [SwHaMaintenanceMode]::Off)
{
Write-Host "Device is in maintenance mode" -foreground yellow
}
elseif($device.SyncStatus -ne [SwHaSyncStatus]::SW_HA_SYNC_STATUS_SYNC)
{
Write-Host "Synchronize device $($device.name)" -foreground yellow
$device.Synchronize([SwHaSyncType]::SW_HA_SYNC_FULL, "")
#$device.MarkAsSynchronized()
}
else
{
Write-Host "Device $($device.name) is synchronized" -foreground yellow
}
}
catch
{
Write-Host $_ -foreground red
}
finally
{
$server.Disconnect()
}
Code: Select all
.\SyncHaDevice.ps1
Device not found.\StatusNode1.ps1
Name TargetName
---- ----------
HAImage1 iqn.2008-08.com.starwindsoftware:172.22.22.38-starwind-vsan01
imagefile1 empty
Code: Select all
param($addr="172.22.22.38", $port=3261, $user="root", $password="starwind", $deviceName="iqn.2008-08.com.starwindsoftware:172.22.22.38-starwind-vsan01")
Import-Module StarWindX
try
{
Enable-SWXLog
$server = New-SWServer $addr $port $user $password
$server.Connect()
$device = Get-Device $server -name $deviceName
if( !$device )
{
Write-Host "Device not found" -foreground red
return
}
if($device.MaintenanceMode -ne [SwHaMaintenanceMode]::Off)
{
Write-Host "Device is in maintenance mode" -foreground yellow
}
elseif($device.SyncStatus -ne [SwHaSyncStatus]::SW_HA_SYNC_STATUS_SYNC)
{
Write-Host "Synchronize device $($device.name)" -foreground yellow
$device.Synchronize([SwHaSyncType]::SW_HA_SYNC_FULL, "")
#$device.MarkAsSynchronized()
}
else
{
Write-Host "Device $($device.name) is synchronized" -foreground yellow
}
}
catch
{
Write-Host $_ -foreground red
}
finally
{
$server.Disconnect()
}
I don't like having these undefined situations because this solution is a test for production deployment. I have nothing on the LUN, and right now, even if one node is fine (the one that has given me less work than the other), the situation isn't stable in my scenario..\SyncHaDevice.ps1
Device not found
Still is.Is this procedure valid for removal?