VMware Cloud Community
ShubhadaS
Contributor
Contributor

how to verify the detached lun's removal state from the host

Hi,

1. We have a requirement to remove the LUN state information from the host after detaching the LUN.

    For this we are using deleteScsiLunState API.

    I want a way to verify that, if SCSI LUN state is deleted from the host successfully.

2. After detaching lun and deleting the LUN state from the host, I want the same LUN available for adding in the new datastore. Currently I am not able to see the LUN in the available LUN list.(I am trying through VC)

Regards,

Shubhada

0 Kudos
6 Replies
UmeshAhuja
Commander
Commander

Hi,

Go through the link below... Answer all your queries.

http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=200460...

Thanks n Regards
Umesh Ahuja

If your query resolved then please consider awarding points by correct or helpful marking.
0 Kudos
ShubhadaS
Contributor
Contributor

Thanks.

Is there any way to do  through vSphere client or API?

0 Kudos
a_nut_in
Expert
Expert

If the datastore has been successfully removed, #esxcfg-scsidevs -m will not show the device as mounted but esxcli software core device list should still show the device as available for creating a new datastore

On the vSphere Client, the device should not show up under "storage" but should list under "storage adapters"

Do remember to mark my post as "helpful" or "correct" if I've helped resolve or answer your query!
0 Kudos
ShubhadaS
Contributor
Contributor

Do you know the way through powerCLI or vSphere client for checking the LUN state information in the host?

I observed that, deleteScsiLunState() ends with success even if the LUN is not detached and datasore is mounted.

0 Kudos
King_Robert
Hot Shot
Hot Shot

Unmounting a LUN using the command line

To unmount a LUN from an ESXi 5.x host using the command line:

  1. If the LUN is an RDM, skip to step 4. Otherwise, to obtain a list of all datastores mounted to an ESXi host, run the command:

    # esxcli storage filesystem list

    The output, which lists all VMFS datastores, is similar to:

    Mount Point                                       Volume Name UUID                                Mounted Type         Size         Free
    ------------------------------------------------- ----------- ----------------------------------- ------- ------ -----------  -----------
    /vmfs/volumes/4de4cb24-4cff750f-85f5-0019b9f1ecf6 datastore1  4de4cb24-4cff750f-85f5-0019b9f1ecf6    true  VMFS-5   140660178944   94577360896
    /vmfs/volumes/4c5fbff6-f4069088-af4f-0019b9f1ecf4 Storage2    4c5fbff6-f4069088-af4f-0019b9f1ecf4    true  VMFS-3   146028888064    7968129024
    /vmfs/volumes/4c5fc023-ea0d4203-8517-0019b9f1ecf4 Storage4    4c5fc023-ea0d4203-8517-0019b9f1ecf4    true  VMFS-3   146028888064  121057050624
    /vmfs/volumes/4e414917-a8d75514-6bae-0019b9f1ecf4 LUN01      4e414917-a8d75514-6bae-0019b9f1ecf4    true  VMFS-5  146028888064   4266131456
0 Kudos
tschoergez
Leadership
Leadership

Take King_Robert's answer in combination with this solution to call esxcli from vCO workflows, and you should be able to automate it.

https://communities.vmware.com/message/2314278

The original answer if all that is available directly via the vCenter API still stands unanswered I guess...

Cheers,

Joerg

0 Kudos