Cant create ISCSI target

Software-based VM-centric and flash-friendly VM storage + free version

Moderators: anton (staff), art (staff), Max (staff), Anatoly (staff)

Post Reply
dgilkey
Posts: 1
Joined: Mon Sep 16, 2024 1:19 am

Mon Sep 16, 2024 1:23 am

Here is my sample script:

Code: Select all

param($addr="10.0.0.250", $port=3261, $user="root", $password="starwind",
	$fileName="vmware",
	$filePath="VSA Storage\mnt\md0\datastore",
	$size=13000GB,
	$targetAlias="vmwaretarget",
	$sectorSize=4096,
	$numaNode=0,
	$cacheMode="writeback",
	$cacheSize=16GB)

Import-Module StarWindX

try
{
	Enable-SWXLog -level SW_LOG_LEVEL_DEBUG

	if($sectorSize -eq 4096 -and $size -lt 2)
	{
		throw "Minimal device size 2MB"
	}

	$server = New-SWServer -host $addr -port $port -user $user -password $password

	$server.Connect()

	#create image file
	New-ImageFile -server $server -path $filePath -fileName $fileName -size $size
    
	#create device
	$device = Add-ImageDevice -server $server -path $filePath -fileName $fileName -sectorSize $sectorSize -NumaNode $numaNode -CacheMode $cacheMode -CacheSize $cacheSize

	$device
    
	#create target
	$target = New-Target -server $server -alias $targetAlias -devices $device.Name

	$target
}
catch
{
	Write-Host $_ -foreground red
}
finally
{
	$server.Disconnect()
}
I get this error:

-
control ImageFile -CreateImage:"VSA Storage\mnt\md0\datastore\vmware.img" -Size:"13958643712000" -Flat:"True" -DeferredInit:"True"
-
200 Failed: There is not enough space on the disk..


But under free capacity:

Mounted

md0

14.16 TB

14.05 TB

Standard

-

/mnt/md0/datastore

Any ideas?
yaroslav (staff)
Staff
Posts: 3171
Joined: Mon Nov 18, 2019 11:11 am

Mon Sep 16, 2024 12:01 pm

Hi,

Welcome to StarWind Forum and thanks for your post.
There are several things that are not OK with this script:
1. Do not use WB caching for a standalone image.
2. you are referring to the wrong path name is wrong. See how to specify it correctly viewtopic.php?f=5&t=6852&p=37208&hilit=HINT8#p37208.
3. Setting 4k for the sectorSize will this target not usable in Linux. Set it to 512 for interoperability.

If you want to create the HA device later, please use viewtopic.php?f=5&t=6852&p=37208&hilit=HINT8#p37208.
Post Reply