VMware

This Question is Answered

1 "correct" answer available (10 pts) 2 "helpful" answers available (6 pts)
7 Replies Last post: Feb 13, 2009 2:14 AM by vmiscsi1  

iSCSI Target VM rescan posted: Feb 10, 2009 8:43 AM

Click to view vmiscsi1's profile Lurker 3 posts since
Feb 10, 2009

Hi,

The setup is as follows: Using ESX 3.5 a Virtual Machine has been created on a the VMFS data store and takes up most of the disk space on the VMFS. An iSCSI target has been created on this Virtual Machine. The ESX iSCSI initiator was setup pointing to the iSCSI target on the Virtual Machine. A new VM was created on the iSCSI target.

When the ESX host machine is rebooted the iSCSI Target Virtual Machine boots up but the Virtual Machine installed on the iSCSI target does not appear in VI Client. Instead it is marked by the label 'Unknown (inaccessible)'. This makes sence because the Virtual Machine holding the iSCSI target, and therefore the Virtual Machine on the iSCSI target, cannot be referenced at boot up.

By rescanning the Storage Adapters in VI Client, the Virtual Machine installed on the iSCSI Target virtual machine magically appears and can be started as normal. My question is how can this rescan be done from the command line. I have tried the esxcfg-rescan command but believe the 'rescan' link in VI Client does a lot more than is immediately obvious.

Thanks.

Re: iSCSI Target VM rescan

1. Feb 10, 2009 9:20 AM in response to: vmiscsi1
Click to view weinstein5's profile Guru vExpert 7,077 posts since
Nov 19, 2005
esxcfg-rescan command should do it - I would also look at the shutdown/startup vm sequence

If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful

Re: iSCSI Target VM rescan

2. Feb 10, 2009 11:18 AM in response to: vmiscsi1
Click to view kjb007's profile Guru vExpert 5,624 posts since
Sep 18, 2006

the esxcfg-rescan command is really all that should be required. the rescan in the GUI rescans all of your HBA's at the same time, so you'll have to manually run esxcfg-rescan against all of your HBA's. Restarting the hostd (service mgmt-vmware restart) or restarting the management agents on ESXi should finish things up, but the rescan link does not do this.

-KjB

Re: iSCSI Target VM rescan

3. Feb 11, 2009 7:10 AM in response to: kjb007
Click to view Texiwill's profile Guru User Moderators vExpert 10,432 posts since
Jan 13, 2004
Hello,

Remember ESX does not like a VMFS that is 100% full. You need space for sundry files associated with the VM. Perhaps no more than 80-90% full. Too full and the VM may not boot.


Best regards,
Edward L. Haletky
VMware Communities User Moderator
====
Author of the book 'VMWare ESX Server in the Enterprise: Planning and Securing Virtualization Servers', Copyright 2008 Pearson Education.
Blue Gears and SearchVMware Pro Blogs -- Top Virtualization Security Links -- Virtualization Security Round Table Podcast

Re: iSCSI Target VM rescan

5. Feb 11, 2009 9:14 AM in response to: vmiscsi1
Click to view Texiwill's profile Guru User Moderators vExpert 10,432 posts since
Jan 13, 2004
Hello,

You may need to 'register' the VM first.. Does the output of vmware-cmd -l show the VM?

does

vmware-cmd -s unregister /full/path/to/VMX
vmware-cmd -s register /full/path/to/VMX

fix anything.

It sounds like the VM is not registered yet.


Best regards,
Edward L. Haletky
VMware Communities User Moderator
====
Author of the book 'VMWare ESX Server in the Enterprise: Planning and Securing Virtualization Servers', Copyright 2008 Pearson Education.
Blue Gears and SearchVMware Pro Blogs -- Top Virtualization Security Links -- Virtualization Security Round Table Podcast

Re: iSCSI Target VM rescan

6. Feb 11, 2009 12:12 PM in response to: vmiscsi1
Click to view kjb007's profile Guru vExpert 5,624 posts since
Sep 18, 2006

The problem as I see it, is that you have a vm that was created in a datastore which is being exported from another vm. When ESX comes up, it checks for its datastores, which it can't find, because the exporting vm is not yet up. Because the datastore is not yet available, the vm that lives on that datastore does not yet exist. After the vm is up and running, and the export is once again available, a rescan brings the datastore back, visible again to ESX. The vm that lives on the newly discovered datastore now needs to be visible again, which it may by itself, in a certain amount of time, after the datastore is visible.

Otherwise, the management agent restart should rush that re-discovery of the ghost vm. Restarting the management agents should not restart the virtual machine. What patch level are you running on your ESX host? Depending on your patch level, and vm auto-start setting, this may be the cause of the vm restart.

-KjB

VMware Beta Programs

Want to be Considered for Future Beta Programs?

Learn More

VMware Developer

Download SDKs, APIs, videos,
training, and more in the Developer community.

Learn More

Developer
Sample Code

Increase your developer productivity with VMware API sample code.

Learn More

VMworld
Sessions & Labs

Online access to the latest VMworld Sessions & Labs and online services.

Learn more

Purchase PSO Credits Online

Purchase credits to redeem training and consulting services online.

Buy Now

Community Hardware Software

View reported configurations or report your own.

Learn More

Only VMware ... Delivers Nexus 1000V

Ensure consistent, policy-based network capabilities to virtual machines across your data center.

Learn More

Communities