Hi All,<\/p>\n
As I only have 1 storage server at the moment (1 to be added later). For the 1 I have now, can I know how to set up its LUNs, I have the below working script for 2 Nodes but not for 1, I’m unsure how to tweak the script for setting up a Single Node..<\/p>\n
Can any one help with this, thanks..<\/p>\n
param($addr=\"192.168.30.225\", $port=3261, $user=\"root\", $password=\"starwind\",\n $addr2=\"192.168.30.226\", $port2=$port, $user2=$user, $password2=$password,\n#common\n\t$initMethod=\"NotSynchronize\",\n\t$size=1024,\n\t$sectorSize=512,\n\t$failover=0,\n\t$bmpType=1,\n\t$bmpStrategy=0,\n#primary node\n\t$imagePath=\"/mnt/md0/vSANStrg\",\n\t$imageName=\"vsn\",\n\t$createImage=$true,\n\t$storageName=\"\",\n\t$targetAlias=\"vsn\",\n\t$poolName=\"pool1\",\n\t$syncSessionCount=1,\n\t$aluaOptimized=$true,\n\t$cacheMode=\"none\",\n\t$cacheSize=0,\n\t$syncInterface=\"#p2=192.168.35.226:3260,192.168.40.226:3260\",\n\t$hbInterface=\"#p2=192.168.45.226:3260,192.168.30.226:3260\",\n\t$createTarget=$true,\n\t$bmpFolderPath=\"\",\n#secondary node\n\t$imagePath2=\"/mnt/md0/vSANStrg\",\n\t$imageName2=\"vsn\",\n\t$createImage2=$true,\n\t$storageName2=\"\",\n\t$targetAlias2=\"vsn\",\n\t$poolName2=\"pool1\",\n\t$syncSessionCount2=1,\n\t$aluaOptimized2=$false,\n\t$cacheMode2=$cacheMode,\n\t$cacheSize2=$cacheSize,\n\t$syncInterface2=\"#p1=192.168.35.225:3260,192.168.40.225:3260\",\n\t$hbInterface2=\"#p1=192.168.45.225:3260,192.168.30.225:3260\",\n\t$createTarget2=$true,\n\t$bmpFolderPath2=\"\"\n )\n\t\nImport-Module StarWindX\n\ntry\n{\n\tEnable-SWXLog -level SW_LOG_LEVEL_DEBUG\n\n\t$server = New-SWServer -host $addr -port $port -user $user -password $password\n\n\t$server.Connect()\n\n\t$firstNode = new-Object Node\n\n\t$firstNode.HostName = $addr\n\t$firstNode.HostPort = $port\n\t$firstNode.Login = $user\n\t$firstNode.Password = $password\n\t$firstNode.ImagePath = $imagePath\n\t$firstNode.ImageName = $imageName\n\t$firstNode.Size = $size\n\t$firstNode.CreateImage = $createImage\n\t$firstNode.StorageName = $storageName\n\t$firstNode.TargetAlias = $targetAlias\n\t$firstNode.AutoSynch = $autoSynch\n\t$firstNode.SyncInterface = $syncInterface\n\t$firstNode.HBInterface = $hbInterface\n\t$firstNode.PoolName = $poolName\n\t$firstNode.SyncSessionCount = $syncSessionCount\n\t$firstNode.ALUAOptimized = $aluaOptimized\n\t$firstNode.CacheMode = $cacheMode\n\t$firstNode.CacheSize = $cacheSize\n\t$firstNode.FailoverStrategy = $failover\n\t$firstNode.CreateTarget = $createTarget\n\t$firstNode.BitmapStoreType = $bmpType\n\t$firstNode.BitmapStrategy = $bmpStrategy\n\t$firstNode.BitmapFolderPath = $bmpFolderPath\n \n\t#\n\t# device sector size. Possible values: 512 or 4096(May be incompatible with some clients!) bytes. \n\t#\n\t$firstNode.SectorSize = $sectorSize\n \n\t$secondNode = new-Object Node\n\n\t$secondNode.HostName = $addr2\n\t$secondNode.HostPort = $port2\n\t$secondNode.Login = $user2\n\t$secondNode.Password = $password2\n\t$secondNode.ImagePath = $imagePath2\n\t$secondNode.ImageName = $imageName2\n\t$secondNode.CreateImage = $createImage2\n\t$secondNode.StorageName = $storageName2\n\t$secondNode.TargetAlias = $targetAlias2\n\t$secondNode.AutoSynch = $autoSynch2\n\t$secondNode.SyncInterface = $syncInterface2\n\t$secondNode.HBInterface = $hbInterface2\n\t$secondNode.SyncSessionCount = $syncSessionCount2\n\t$secondNode.ALUAOptimized = $aluaOptimized2\n\t$secondNode.CacheMode = $cacheMode2\n\t$secondNode.CacheSize = $cacheSize2\n\t$secondNode.FailoverStrategy = $failover\n\t$secondNode.CreateTarget = $createTarget2\n\t$secondNode.BitmapFolderPath = $bmpFolderPath2\n \n\t$device = Add-HADevice -server $server -firstNode $firstNode -secondNode $secondNode -initMethod $initMethod\n \n\twhile ($device.SyncStatus -ne [SwHaSyncStatus]::SW_HA_SYNC_STATUS_SYNC)\n\t{\n\t\t$syncPercent = $device.GetPropertyValue(\"ha_synch_percent\")\n\t Write-Host \"Synchronizing: $($syncPercent)%\" -foreground yellow\n\n\t\tStart-Sleep -m 2000\n\n\t\t$device.Refresh()\n\t}\n}\ncatch\n{\n\tWrite-Host $_ -foreground red \n}\nfinally\n{\n\t$server.Disconnect()\n}\n<\/code><\/pre>","upvoteCount":4,"answerCount":7,"datePublished":"2025-07-28T08:00:40.338Z","author":{"@type":"Person","name":"tryllz","url":"https://community.spiceworks.com/u/tryllz"},"acceptedAnswer":{"@type":"Answer","text":"