Removing a LUN from Starwind using commandline

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

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

Post Reply
labops-evault
Posts: 2
Joined: Wed Oct 31, 2018 4:14 pm

Wed Oct 31, 2018 4:20 pm

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
Boris (staff)
Staff
Posts: 805
Joined: Fri Jul 28, 2017 8:18 am

Wed Oct 31, 2018 6:15 pm

Could you tell me your StarWind build?
labops-evault
Posts: 2
Joined: Wed Oct 31, 2018 4:14 pm

Wed Oct 31, 2018 6:46 pm

Starwind Management Console for Windows. Version 8.0.0.11456
Boris (staff)
Staff
Posts: 805
Joined: Fri Jul 28, 2017 8:18 am

Fri Nov 02, 2018 9:35 pm

Submit a support ticket referring this thread. We will update the community regarding the result.
Boris (staff)
Staff
Posts: 805
Joined: Fri Jul 28, 2017 8:18 am

Tue Nov 13, 2018 9:11 pm

Removing the target before deleting the LUN solved the issue.
Post Reply