VMware Cloud Community
dmaster
VMware Employee
VMware Employee
Jump to solution

howto rescan your vmfs datastores with the service console

Hello all,

i am looking for the command to do a rescan of the vmfs datastores attached to a specific ESX hosts.

i allready found the command : esxcfg-rescan vmhba1

But this results only in a rescan of attached lun's the the hba. And not in updating the vmfs datastore list.

When you press rescan in VirtualCenter in the storage section, you will see two tasks: (this means there must be a seperate command for it)

1) rescan hbas

2) rescan datastores

Anybody a clue for me ?

Reply
0 Kudos
1 Solution

Accepted Solutions
kjb007
Immortal
Immortal
Jump to solution

The esxcfg-rescan command is actually a wrapper that runs vmkfstools/scantools in the background. As weinstein5 has pointed out, this will update both LUNs and VMFS's, provided they are not seen as a snapshot. What you are seeing in the GUI are the equivalent commands run directly, which the wrapper esxcfg-rescan automatically does.

-KjB

vExpert/VCP/VCAP vmwise.com / @vmwise -KjB

View solution in original post

Reply
0 Kudos
8 Replies
weinstein5
Immortal
Immortal
Jump to solution

If you rescan an HBA and there is an already configured VMFS datastoreconfigured it should show up - if there is not a VMFS system on the datastore ESX will not recognize it as a datastore

If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful
Reply
0 Kudos
espi3030
Expert
Expert
Jump to solution

Have you tried -- service vmware-vpxa restart ?

Reply
0 Kudos
dmaster
VMware Employee
VMware Employee
Jump to solution

Hello All,

When i rescan my hba's on the service console (all commands must be configured through the service console). it only updates the lun's attached to the esx host.

the rescanning of the hba will be done with : esxcfg-rescan vmhba1

my vmfs volumes are not updated. when i do a rescan with vi-client i see two checkboxes/tasks wich will be carried out when pressing on rescan in the storage adapters section.

i am looking for the command wich is behind this checkbox.

Reply
0 Kudos
dmaster
VMware Employee
VMware Employee
Jump to solution

No i Have not tried -- service vmware-vpxa restart ?

because the vi-client should not be restarted.

Reply
0 Kudos
weinstein5
Immortal
Immortal
Jump to solution

esxcfg-rescan is the command that does this - when you run this from the command from the service console CLI and do a ls /vmfs/volumes/ does it show the VMFS that is on the new VMFA data store? or are you looking for the command to create a VMFA datastore on the new LUN? to do that it would be vmkfstool -C vmfs3 -S VMFS_Volume_Label partion_address(vmhba.#.#.#)

If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful
Reply
0 Kudos
vswami
Contributor
Contributor
Jump to solution

to update the vmfs list, you also need to run "vimsh -ne 'hostsvc/storage/refresh" after doing the rescan of the HBAs

kjb007
Immortal
Immortal
Jump to solution

The esxcfg-rescan command is actually a wrapper that runs vmkfstools/scantools in the background. As weinstein5 has pointed out, this will update both LUNs and VMFS's, provided they are not seen as a snapshot. What you are seeing in the GUI are the equivalent commands run directly, which the wrapper esxcfg-rescan automatically does.

-KjB

vExpert/VCP/VCAP vmwise.com / @vmwise -KjB
Reply
0 Kudos
dmaster
VMware Employee
VMware Employee
Jump to solution

Hello vswami,

Thanx for the reply.. this is exactly what i am looking for.

i accidently gave the wrong person the most points for the answer.. sorry for that.

maybe one of the moderators can change this.

Regards,

dmaster

Reply
0 Kudos