VMware Cloud Community
Crocko
Contributor
Contributor

big eror : deleted a Datastore on storage

Hi all,

I'm a little bit disappointed with my big mistake : I've deleted the LUN mapped to our ESX 4.0 infra.

"fortunaly", there was only 1 usefull VM.

The issue is tha Datastore is still in Datastore list, VMs are still in running status and it block the Datastore Management (can't delete Datastore in cause of Vm status).

LUN mapping from Netapp can't be done because LUN has been deleted on Netapp infra

I want to setVMs as status "powerred off"to be able to remove Datastore.

I've tried several things.

root@blvsrvesx38 ~]# vim-cmd vmsvc/power.getstate 704

Retrieved runtime info

Powered on

[root@blvsrvesx38 ~]# vim-cmd vmsvc/power.off 704

Powering off VM:

(vim.fault.TaskInProgress) {

   dynamicType = <unset>,

   faultCause = (vmodl.MethodFault) null,

   task = 'vim.Task:haTask-704-vim.VirtualMachine.powerOff-5320446',

   msg = "Another task is already in progress.",

}

THEN

[root@blvsrvesx38 ~]# vim-cmd vmsvc/unregister 704

(vim.fault.InvalidPowerState) {

   dynamicType = <unset>,

   faultCause = (vmodl.MethodFault) null,

   requestedState = "poweredOff",

   existingState = "poweredOn",

   msg = "The attempted operation cannot be performed in the current state (Powered On).",

}

Also via sql request following this KB: VMware KB: Unable to remove a datastore from the vCenter Server 4.x / 5.x inventory

select ID from VPX_ENTITY where name ='Datastore44';

returns no result

Is there an other way to remove VMs and Datastore Enty ? Thanks for you help !

0 Kudos
5 Replies
khaliqamar
Enthusiast
Enthusiast

try this

vmware-cmd <path.vmx> stop hard


and if it is still not working you might have to reboot your host where it is registered.

0 Kudos
Crocko
Contributor
Contributor

Thanks, but it didn't work.

[root@blvsrvesx38 ~]# vmware-cmd BLVSAPIDM01 stop hard

vim.fault.InvalidPowerState: The attempted operation cannot be performed in the current state (Powered Off).

0 Kudos
khaliqamar
Enthusiast
Enthusiast

in this KB http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=100434...

there is a way to kill  by its process ID. ( follow it)

if this also not works - reboot your hosts

Crocko
Contributor
Contributor

I have more info but not working.

Look at the path it provides me :

[] /vmfs/volumes/4f7ac6e2-91940eae-e259-78e7d1567e20/BLVSAPIDM01/BLVSAPIDM01.vmx

instead of

/vmfs/volumes/

With vmid, the concerned vm is not listed....

I'll have to reboot host... In cause of this situation, vmotion doesn't work too... 2 hosts are concerned and 20 VM to shutdown...

Thanks for you help VirtualRay !

0 Kudos
Crocko
Contributor
Contributor

I've restarted both esx concerned by VM situated on deleted Datastore. Datastore was automatically removed locally after reboot. I also restarted the virtual center to update status and the lost datatore disapeared !

Nightmare is end !

0 Kudos