Page 1 of 1

Removing a LUN from Starwind using commandline

Posted: Wed Oct 31, 2018 4:20 pm
by labops-evault
Hi,

I'm attempting to remove one of my 8 iSCSI LUNs and I get an error message each time I try to. I've tried disconnecting all hosts from the iscsi targets and then running the script, rebooting the machine and run the script right away and still nothing.
Here is the script I'm running:

$server.Connect()

if ( $server.Connected )
{

$deviceid = Get-DeviceID -deviceName ImageFile1 -server $server

$result = Read-host -Prompt "Are you sure you want to delete device [$deviceid] [N/y]?"

if ($result -eq 'y'){
Remove-Device -server $server -deviceId $deviceid -Force $true
}


$server.Disconnect()
}

The error is below:

Error:
104 Command rejected by the server..
At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\StarWindX\StarWindX.psm1:117 char:9
+ $server.RemoveDevice( $deviceId, $true)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (:) [], COMException
+ FullyQualifiedErrorId : System.Runtime.InteropServices.COMException

Re: Removing a LUN from Starwind using commandline

Posted: Wed Oct 31, 2018 6:15 pm
by Boris (staff)
Could you tell me your StarWind build?

Re: Removing a LUN from Starwind using commandline

Posted: Wed Oct 31, 2018 6:46 pm
by labops-evault
Starwind Management Console for Windows. Version 8.0.0.11456

Re: Removing a LUN from Starwind using commandline

Posted: Fri Nov 02, 2018 9:35 pm
by Boris (staff)
Submit a support ticket referring this thread. We will update the community regarding the result.

Re: Removing a LUN from Starwind using commandline

Posted: Tue Nov 13, 2018 9:11 pm
by Boris (staff)
Removing the target before deleting the LUN solved the issue.