Skip navigation
VMware
1,274 Views 4 Replies Last post: Mar 3, 2008 8:29 AM by chris_bennett RSS
dmitry_sorokin Lurker 2 posts since
Mar 22, 2006
Currently Being Moderated

Mar 7, 2007 2:45 PM

Rescan HBAs from the console

I'm scripting some VM operations using commands on ESX 3.0.1 console.

One of the steps is to rescan iSCSI software HBA, register VM and start VM.

 

Step 1 - Rescan iSCSI HBA:

\[root@esx7 root]# /usr/sbin/esxcfg-rescan vmhba40

Doing iSCSI discovery.  This can take a few seconds ...

Rescanning vmhba40...done.

On scsi5, removing:.

On scsi5, adding: 0:0.

 

That worked fine, can see the vmfs:

\[root@esx7 root]# ls -al /vmfs/volumes/VMware.Demo.AD0/

total 574528

drwxrwxrwt    1 root     root         1120 Feb 13 17:20 .

drwxrwxrwx    1 root     root          512 Mar  7 15:30 ..

-r----


    1 root     root       229376 Feb 13 17:18 .fbb.sf

-r----


    1 root     root     64946176 Feb 13 17:18 .fdc.sf

-r----


    1 root     root     255655936 Feb 13 17:18 .pbc.sf

-r----


    1 root     root     260366336 Feb 13 17:18 .sbc.sf

-r----


    1 root     root      4194304 Feb 13 17:18 .vh.sf

drwxr-xr-x    1 root     root         2940 Mar  7 15:29 VMware.Demo.ad0

 

Step 2 - Register VM:

\[root@esx7 root]# vmware-cmd -s register /vmfs/volumes/VMware.Demo.AD0/VMware.Demo.ad0/VMware.Demo.ad0.vmx

register(/vmfs/volumes/VMware.Demo.AD0/VMware.Demo.ad0/VMware.Demo.ad0.vmx) = 1

That worked fine too:

\[root@esx7 root]# vmware-cmd -l

/vmfs/volumes/45d25552-8aa9c523-bf7d-00093d1167c8/VMware.Demo.ad0/VMware.Demo.ad0.vmx

 

Step 3 - Start VM:

\[root@esx7 root]# vmware-cmd /vmfs/volumes/VMware.Demo.AD0/VMware.Demo.ad0/VMware.Demo.ad0.vmx start

VMControl error -999: Unknown error: SoapError: ServerFaultCode(1987) : (Attempt to power on a virtual machine with the .vmx file not stored on a NAS or VMFS version 3 datastore. The virtual machine files must be relocated or VMFS upgraded.)

 

Obviously, this step fails for some strange reason.

 

I tried to use LUN UUID instead of alias, but the result is the same:

\[root@esx7 root]# vmware-cmd /vmfs/volumes/45d25552-8aa9c523-bf7d-00093d1167c8/VMware.Demo.ad0/VMware.Demo.ad0.vmx start                    VMControl error -999: Unknown error: SoapError: ServerFaultCode(1987) : (Attempt to power on a virtual machine with the .vmx file not stored on a NAS or VMFS version 3 datastore. The virtual machine files must be relocated or VMFS upgraded.)

 

Any ideas what I'm missing?

 

Thaks a lot,

Dmitry

chris_bennett Novice 36 posts since
Jul 26, 2005
Currently Being Moderated
2. Mar 3, 2008 7:54 AM in response to: dmitry_sorokin
Re: Rescan HBAs from the console

 

dmitry_sorokin,

 

 

Did you ever work out what was causing this, I have run into the exact same problem, but I'm struggling to work out the reason.

 

 

Cheers

Chris

 

 

Hot Shot VMware Employees 210 posts since
Apr 15, 2004
Currently Being Moderated
3. Mar 3, 2008 8:20 AM in response to: dmitry_sorokin
Re: Rescan HBAs from the console

 

Try running /etc/init.d/vmware-mgmt restart  at the end of your script just before issueing vmware-cmd calls.

 

 

chris_bennett Novice 36 posts since
Jul 26, 2005
Currently Being Moderated
4. Mar 3, 2008 8:29 AM in response to: kkress
Re: Rescan HBAs from the console

Thanks, adding a restart of the mgmt-vmware does appear to correct this when stepping through the process manually. Cheers

Bookmarked By (0)

Share This Page

Communities