The Latest Gartner® Magic Quadrant™Hyperconverged Infrastructure Software
Moderators: anton (staff), art (staff), Max (staff), Anatoly (staff)
Code: Select all
param($addr="192.168.0.251", $port=3261, $user="root", $password="starwind",
$addr2="192.168.0.252", $port2=$port, $user2=$user, $password2=$password,
#common
$initMethod="Clear",
# $size=1550000,
$size=1024,
$sectorSize=512,
$failover=0,
#primary node
$imagePath="/mnt/ssd",
$imageName="ssd01",
$createImage=$true,
$storageName="",
$targetAlias="ssd01",
$autoSynch=$true,
$poolName="pool1",
$syncSessionCount=1,
$aluaOptimized=$true,
$cacheMode="none",
$cacheSize="",
$syncInterface="#p2=172.16.255.12:3260" -f $addr2,
$hbInterface="#p2=172.16.250.12:3260" -f $addr2,
$createTarget=$true,
#secondary node
$imagePath2="/mnt/ssd",
$imageName2="ssd02",
$createImage2=$true,
$storageName2="",
$targetAlias2="ssd02",
$autoSynch2=$true,
$poolName2="pool1",
$syncSessionCount2=1,
$aluaOptimized2=$false,
$cacheMode2=$cacheMode,
$cacheSize2=$cacheSize,
$syncInterface2="#p1=172.16.250.11:3260" -f $addr,
$hbInterface2="#p1=172.16.255.11:3260" -f $addr,
$createTarget2=$true
)
Import-Module StarWindX
try
{
Enable-SWXLog
$server = New-SWServer -host $addr -port $port -user $user -password $password
$server.Connect()
$firstNode = new-Object Node
$firstNode.HostName = $addr
$firstNode.HostPort = $port
$firstNode.Login = $user
$firstNode.Password = $password
$firstNode.ImagePath = $imagePath
$firstNode.ImageName = $imageName
$firstNode.Size = $size
$firstNode.CreateImage = $createImage
$firstNode.StorageName = $storageName
$firstNode.TargetAlias = $targetAlias
$firstNode.AutoSynch = $autoSynch
$firstNode.SyncInterface = $syncInterface
$firstNode.HBInterface = $hbInterface
$firstNode.PoolName = $poolName
$firstNode.SyncSessionCount = $syncSessionCount
$firstNode.ALUAOptimized = $aluaOptimized
$firstNode.CacheMode = $cacheMode
$firstNode.CacheSize = $cacheSize
$firstNode.FailoverStrategy = $failover
$firstNode.CreateTarget = $createTarget
#
# device sector size. Possible values: 512 or 4096(May be incompatible with some clients!) bytes.
#
$firstNode.SectorSize = $sectorSize
$secondNode = new-Object Node
$secondNode.HostName = $addr2
$secondNode.HostPort = $port2
$secondNode.Login = $user2
$secondNode.Password = $password2
$secondNode.ImagePath = $imagePath2
$secondNode.ImageName = $imageName2
$secondNode.CreateImage = $createImage2
$secondNode.StorageName = $storageName2
$secondNode.TargetAlias = $targetAlias2
$secondNode.AutoSynch = $autoSynch2
$secondNode.SyncInterface = $syncInterface2
$secondNode.HBInterface = $hbInterface2
$secondNode.SyncSessionCount = $syncSessionCount2
$secondNode.ALUAOptimized = $aluaOptimized2
$secondNode.CacheMode = $cacheMode2
$secondNode.CacheSize = $cacheSize2
$secondNode.FailoverStrategy = $failover
$secondNode.CreateTarget = $createTarget2
$device = Add-HADevice -server $server -firstNode $firstNode -secondNode $secondNode -initMethod $initMethod
while ($device.SyncStatus -ne [SwHaSyncStatus]::SW_HA_SYNC_STATUS_SYNC)
{
$syncPercent = $device.GetPropertyValue("ha_synch_percent")
Write-Host "Synchronizing: $($syncPercent)%" -foreground yellow
Start-Sleep -m 2000
$device.Refresh()
}
}
catch
{
Write-Host $_ -foreground red
}
finally
{
$server.Disconnect()
}
Code: Select all
param($addr="192.168.0.251", $port=3261, $user="root", $password="starwind",
$addr2="192.168.0.252", $port2=$port, $user2=$user, $password2=$password,
#common
$initMethod="Clear",
# $size=1550000,
$size=1024,
$sectorSize=512,
$failover=0,
#primary node
$imagePath="/mnt/ssd",
$imageName="ssd01",
$createImage=$true,
$storageName="",
$targetAlias="ssd01",
$autoSynch=$true,
$poolName="pool1",
$syncSessionCount=1,
$aluaOptimized=$true,
$cacheMode="none",
$cacheSize="",
$syncInterface="#p2=172.16.255.12:3260" -f $addr2,
$hbInterface="#p2=172.16.250.12:3260,192.168.0.252:3260" -f $addr2,
$createTarget=$true,
#secondary node
$imagePath2="/mnt/ssd",
$imageName2="ssd02",
$createImage2=$true,
$storageName2="",
$targetAlias2="ssd02",
$autoSynch2=$true,
$poolName2="pool1",
$syncSessionCount2=1,
$aluaOptimized2=$true,
$cacheMode2=$cacheMode,
$cacheSize2=$cacheSize,
$syncInterface2="#p1=172.16.250.11:3260" -f $addr,
$hbInterface2="#p1=172.16.255.11:3260,192.168.0.251:3260" -f $addr,
$createTarget2=$true
)
Code: Select all
[root@vsan-hv01 storage]# pwd
/opt/StarWind/StarWindVSA/drive_c/StarWind/storage
[root@vsan-hv01 storage]# ls -altr
total 4
lrwxrwxrwx. 1 root root 4 Feb 27 2020 mnt -> /mnt
lrwxrwxrwx. 1 root root 6 Feb 27 2020 media -> /media
drwxr-xr-x. 2 root root 30 Feb 27 2020 .
drwxr-xr-x. 8 root root 4096 Jan 6 10:38 ..
Code: Select all
[root@vsan-hv01 ssd]# pwd
/opt/StarWind/StarWindVSA/drive_c/StarWind/storage/mnt/ssd
[root@vsan-hv01 ssd]# ls -altrh
total 1.1G
drwxr-xr-x. 4 root root 29 Dec 29 15:47 ..
-rw-r--r-- 1 root root 4.0K Jan 6 10:38 ssd01.swdsk
-rw-r--r-- 1 root root 1.0G Jan 6 10:38 ssd01.img
-rw-r--r-- 1 root root 4.0K Jan 6 10:38 ssd01_HA.swdsk
drwxr-xr-x 2 root root 64 Jan 6 10:38 .
Code: Select all
1/6 12:41:46.109369 12d debug: *** Swn_CheckCompletions: io_event for ov 0000000002420380, res 22, err 25!
1/6 12:41:46.109400 12d IMG: *** ImageFile_IoCompleted: Disk operation failed. Disk path: C:\StarWind\storage\mnt\nvme\ssd01.img. Error code: (25).
Are you connecting the NAS to the VM itself? Present the NAS as the iSCSI device to ESXi and put the VMDK there. Try the trial license for test purposes (NOTE: YOU WILL NOT BE ABLE TO SWITCH TO FREE WITHOUT REINSTALLING VM). This will show us if there is something with the script OR the setup.E: and stopping the initiator service
That might be a misunderstanding.Are you connecting the NAS to the VM itself? Present the NAS as the iSCSI device to ESXi and put the VMDK there. Try the trial license for test purposes (NOTE: YOU WILL NOT BE ABLE TO SWITCH TO FREE WITHOUT REINSTALLING VM). This will show us if there is something with the script OR the setup.
Do you have NVMes in NAS?
Code: Select all
HV01
* add device (advanced)
* HDD
* virtual disk
* new virtual disk (name: ssd01; location VSA Storage\mnt\ssd; size: 1gb)
* thick provisioned; 512byte sectors
* no cache
* create new target, alias ssd01
After that with the replication manager
* add partner synchronous replication
* Host ip: 192.168.0.252
* Heartbeat as failover strat
* create new partner device (location: VSA Storage\mnt\ssd) target name also with ssd01
* Networks:
** 172.16.255.0 for heartbeat and sync
** 172.16.250.0 and 192.168.0.0 for heartbeat
* sync from existing device
Code: Select all
param($addr="192.168.0.251", $port=3261, $user="root", $password="starwind",
$addr2="192.168.0.252", $port2=$port, $user2=$user, $password2=$password,
#common
$initMethod="Clear",
# $size=1550000,
$size=1024,
$sectorSize=512,
$failover=0,
#primary node
$imagePath="\mnt\ssd\",
$imageName="ssd01",
$createImage=$true,
$storageName="",
$targetAlias="ssd01",
$autoSynch=$true,
$poolName="pool1",
$syncSessionCount=1,
$aluaOptimized=$true,
$cacheMode="none",
$cacheSize="",
$syncInterface="#p2=172.16.255.12:3260" -f $addr2,
$hbInterface="#p2=172.16.250.12:3260,192.168.0.252:3260" -f $addr2,
$createTarget=$true,
#secondary node
$imagePath2="\mnt\ssd\",
$imageName2="ssd01",
$createImage2=$true,
$storageName2="",
$targetAlias2="ssd01",
$autoSynch2=$true,
$poolName2="pool1",
$syncSessionCount2=1,
$aluaOptimized2=$false,
$cacheMode2=$cacheMode,
$cacheSize2=$cacheSize,
$syncInterface2="#p1=172.16.255.11:3260" -f $addr,
$hbInterface2="#p1=172.16.250.11:3260,192.168.0.251:3260" -f $addr,
$createTarget2=$true
)
Not doing this. The windows server is supposed to server as platform to setup the starwind vsan vms and doing veeam to a storage mounted from a local hardware nas (not from the planned shared starwind iscsi)Please make sure not to use rhe same servers as shared storage to store backups (learn more about 3-2-1 backup rule).
Code: Select all
param($addr="192.168.0.251", $port=3261, $user="root", $password="starwind", $deviceName="HAImage1",
$addr2="192.168.0.252", $port2=$port, $user2=$user, $password2=$password,
#secondary node
$imagePath2="/mnt/ssd",
$imageName2="ssd01",
$createImage2=$true,
$targetAlias2="ssd01",
$autoSynch2=$true,
$poolName2="pool1",
$syncSessionCount2=1,
$aluaOptimized2=$true,
$syncInterface2="#p1=172.16.255.11:3260" -f $addr,
$hbInterface2="#p1=172.16.250.11:3260,192.168.0.251:3260",
$selfSyncInterface="#p1=172.16.255.12:3260" -f $addr2,
$selfHbInterface="#p1=172.16.250.12:3260,192.168.0.252:3260"
)
Code: Select all
1/9 7:39:29.380643 120 FileBrowser: *** CFileBrowser::parsePath: Could not create image : provided path has invalid extension!
1/9 7:39:29.380696 120 Srv: *** iScsiServer::list: Error parsing path: VSA Storage\mnt\
1/9 7:39:29.398050 120 HA: SscPort_ControlRequest: Received Reserve command: 11264 MB
1/9 7:39:30.404790 120 IMG: ImageFile_Extend: Extending/shrinking image by 10240 MBs...
1/9 7:39:30.404834 120 debug: Swn_FileExtendInBytes: File size: 1073741824 - extending for 10737418240 bytes
1/9 7:39:30.404858 120 debug: Swn_GetFileSize: File size: 11811160064, Blocks: 23068672, blksize: 4096 bytes
1/9 7:39:30.404862 120 IMG: ImageFile_Extend: New image size is 11264 MBs.
1/9 7:39:30.404874 120 Common: sw_common::Sw_Disk_Header::open: (file: C:\StarWind\storage\mnt\datastore1-2\datastore1-2.swdsk, readonly: no).
1/9 7:39:30.414320 120 HA: SscPort_ControlRequest: Received Extend command: 11264 MB
1/9 7:39:30.430100 120 conf: ControlConnection::processConnection: Control connection closed.
1/9 7:40:28.616200 6a conf: TelnetListener::listenConnections: Accepted control connection from 192.168.11.78:54446.
1/9 7:40:28.646926 11e FileBrowser: *** CFileBrowser::parsePath: Could not create image : provided path has invalid extension!
1/9 7:40:28.646995 11e Srv: *** iScsiServer::list: Error parsing path: VSA Storage\mnt\
Code: Select all
Synchronize device HAImage1
Failed to perform synchronization (1) from
-
control 0x0000000000EE04C0 -Synchronize: -SynchronizationType:"1"
-
200 Failed: can't find available or valid partner for synchronization..