Powershell errors during test installation.
Posted: Fri Apr 07, 2017 7:39 pm
I just downloaded the "Starwind VSAN Free", version 8.3, product and have been trying to make it work.
Unfortunately, I'm running into errors when I try to create my HA storage.
Here are my two servers (they are identical):
- Dell CS24-NV7 12 Opteron cores, 2TB HDD & 64GB RAM
- 3 NICs
- Hyper-V 2012 R2 (fresh install)
Here is my network configuration:
10.1.1.x = admin network
10.1.2.x = sync network
10.1.3.x = heartbeat network
Server 1:
Name = HCI_SRV_1
IPs = 10.1.1.100, 10.1.2.100 & 10.1.3.100
Server 2:
Name = HCI_SRV_2
IPs = 10.1.1.200, 10.1.2.200 & 10.1.3.200
My directory, on C:, for my Starwind vSAN data is located at C:\VSAN.
I have copied the "CreateHA(two nodes).ps1" file and made edits.
Here is my powershell script:
--- START ---
Import-Module StarWindX
try
{
$server = New-SWServer -host 10.1.1.100 -port 3261 -user root -password starwind
$server.Connect()
$firstNode = new-Object Node
$firstNode.ImagePath = "My computer\C\VSAN"
$firstNode.ImageName = "masterImg1"
$firstNode.Size = 2048
$firstNode.CreateImage = $true
$firstNode.TargetAlias = "targetha1"
$firstNode.AutoSynch = $true
$firstNode.SyncInterface = "#p2=10.1.2.200:3260"
$firstNode.HBInterface = "#p2=10.1.3.200:3260"
$firstNode.CacheSize = 128
$firstNode.CacheMode = "wb"
$firstNode.PoolName = ""
$firstNode.SyncSessionCount = 1
$firstNode.ALUAOptimized = $true
#
# device sector size. Possible values: 512 or 4096(May be incompatible with some clients!) bytes.
#
$firstNode.SectorSize = 4096
#
# 'SerialID' should be between 16 and 31 symbols. If it not specified StarWind Service will generate it.
# Note: Second node always has the same serial ID. You do not need to specify it for second node
#
# $firstNode.SerialID = "050176c0b535403ba3ce02102e33eab"
$secondNode = new-Object Node
$secondNode.HostName = "10.1.1.200"
$secondNode.HostPort = "3261"
$secondNode.Login = "root"
$secondNode.Password = "starwind"
$secondNode.ImagePath = "My computer\C\VSAN"
$secondNode.ImageName = "partnerImg1"
$secondNode.Size = 2048
$secondNode.CreateImage = $true
$secondNode.TargetAlias = "partnerha1"
$secondNode.AutoSynch = $true
$secondNode.SyncInterface = "#p1=10.1.2.100:3260"
$secondNode.HBInterface = "#p1=10.1.3.100:3260"
$secondNode.ALUAOptimized = $true
$device = Add-HADevice -server $server -firstNode $firstNode -secondNode $secondNode -initMethod "Clear"
$syncState = $device.GetPropertyValue("ha_synch_status")
while ($syncState -ne "1")
{
#
# Refresh device info
#
$device.Refresh()
$syncState = $device.GetPropertyValue("ha_synch_status")
$syncPercent = $device.GetPropertyValue("ha_synch_percent")
Start-Sleep -m 2000
Write-Host "Synchronizing: $($syncPercent)%" -foreground yellow
}
}
catch
{
Write-Host "Exception $($_.Exception.Message)" -foreground red
}
$server.Disconnect()
--- END ---
Here is the error I'm getting:
--- START ---
Exception Retrieving the COM class factory for component with CLSID {2DE41C61-CD
75-43A7-9B87-AD38E3E46FEF} failed due to the following error: 80040154 Class not
registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
You cannot call a method on a null-valued expression.
At C:\Program Files\StarWind
Software\StarWind\StarWindX\Samples\powershell\Go_JRM.ps1:76 char:1
+ $server.Disconnect()
+ ~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
--- END ---
I'm open to suggestions.
Unfortunately, I'm running into errors when I try to create my HA storage.
Here are my two servers (they are identical):
- Dell CS24-NV7 12 Opteron cores, 2TB HDD & 64GB RAM
- 3 NICs
- Hyper-V 2012 R2 (fresh install)
Here is my network configuration:
10.1.1.x = admin network
10.1.2.x = sync network
10.1.3.x = heartbeat network
Server 1:
Name = HCI_SRV_1
IPs = 10.1.1.100, 10.1.2.100 & 10.1.3.100
Server 2:
Name = HCI_SRV_2
IPs = 10.1.1.200, 10.1.2.200 & 10.1.3.200
My directory, on C:, for my Starwind vSAN data is located at C:\VSAN.
I have copied the "CreateHA(two nodes).ps1" file and made edits.
Here is my powershell script:
--- START ---
Import-Module StarWindX
try
{
$server = New-SWServer -host 10.1.1.100 -port 3261 -user root -password starwind
$server.Connect()
$firstNode = new-Object Node
$firstNode.ImagePath = "My computer\C\VSAN"
$firstNode.ImageName = "masterImg1"
$firstNode.Size = 2048
$firstNode.CreateImage = $true
$firstNode.TargetAlias = "targetha1"
$firstNode.AutoSynch = $true
$firstNode.SyncInterface = "#p2=10.1.2.200:3260"
$firstNode.HBInterface = "#p2=10.1.3.200:3260"
$firstNode.CacheSize = 128
$firstNode.CacheMode = "wb"
$firstNode.PoolName = ""
$firstNode.SyncSessionCount = 1
$firstNode.ALUAOptimized = $true
#
# device sector size. Possible values: 512 or 4096(May be incompatible with some clients!) bytes.
#
$firstNode.SectorSize = 4096
#
# 'SerialID' should be between 16 and 31 symbols. If it not specified StarWind Service will generate it.
# Note: Second node always has the same serial ID. You do not need to specify it for second node
#
# $firstNode.SerialID = "050176c0b535403ba3ce02102e33eab"
$secondNode = new-Object Node
$secondNode.HostName = "10.1.1.200"
$secondNode.HostPort = "3261"
$secondNode.Login = "root"
$secondNode.Password = "starwind"
$secondNode.ImagePath = "My computer\C\VSAN"
$secondNode.ImageName = "partnerImg1"
$secondNode.Size = 2048
$secondNode.CreateImage = $true
$secondNode.TargetAlias = "partnerha1"
$secondNode.AutoSynch = $true
$secondNode.SyncInterface = "#p1=10.1.2.100:3260"
$secondNode.HBInterface = "#p1=10.1.3.100:3260"
$secondNode.ALUAOptimized = $true
$device = Add-HADevice -server $server -firstNode $firstNode -secondNode $secondNode -initMethod "Clear"
$syncState = $device.GetPropertyValue("ha_synch_status")
while ($syncState -ne "1")
{
#
# Refresh device info
#
$device.Refresh()
$syncState = $device.GetPropertyValue("ha_synch_status")
$syncPercent = $device.GetPropertyValue("ha_synch_percent")
Start-Sleep -m 2000
Write-Host "Synchronizing: $($syncPercent)%" -foreground yellow
}
}
catch
{
Write-Host "Exception $($_.Exception.Message)" -foreground red
}
$server.Disconnect()
--- END ---
Here is the error I'm getting:
--- START ---
Exception Retrieving the COM class factory for component with CLSID {2DE41C61-CD
75-43A7-9B87-AD38E3E46FEF} failed due to the following error: 80040154 Class not
registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
You cannot call a method on a null-valued expression.
At C:\Program Files\StarWind
Software\StarWind\StarWindX\Samples\powershell\Go_JRM.ps1:76 char:1
+ $server.Disconnect()
+ ~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
--- END ---
I'm open to suggestions.