hjgl wrote:Hi all,
I was searching how to attach a new disk to my existing storage in PS, but i can't find documentation about this. In PS examples files (CreateImageFile.ps1), when i run this script, this dettach all devices and then attach the new one.
Anybody can help me? Thanks in advance.
Oh i'm sorry, i'm not english speaker. My setup is stand alone in windows 2012 on test environment. I want create a new virtual disk in my storage, called "vSAN". This "vSAN" have 17 virtual disk working fine and i want add one more. When i ran the CreateImageFile.ps1 script, this script dettach all my virtual disks and then attach only the new one.
My Script is this:
Import-Module StarWindX
try
{
$server = New-SWServer -host 127.31.0.6 -port 3261 -user root -password starwind
$server.Connect()
#create image file
New-ImageFile -server $server -path "My Computer\D\VM\Shared Storage\SQLData05" -fileName "imagefile18" -size 120
#create device
$device = Add-ImageDevice -server $server -path "My Computer\D\VM\Shared Storage\SQLData05" -fileName "imagefile18" -sectorSize 512 -NumaNode 0
#create target
$target = New-Target -server $server -alias "vSAN" -devices $device.Name
#$target
}
catch
{
Write-Host $_ -foreground red
}
finally
{
$server.Disconnect()
}
If i skip the "Create Target" label, then the disk is created but not attached to the "vSAN" storage. Please, help.