Announcement

Collapse
No announcement yet.

Unable to delete VM directory from Datastore

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Unable to delete VM directory from Datastore

    Hi All,

    I've got a broken VM which was failed to start, it is Windows Vista VM which i couldn't bring it back online again after it suspended itself, I did services.sh restart command and I was able to delete from the Disk

    but then i still could not delete the remaining files in the directory ?

    there are two files namely:

    WindowsVista_Ex-e346672a.vswp
    WindowsVista_Ex-flat.vmdk


    i cannot delete it from the datastore browser or even kill it from the SSH console as follows:


    Code:
    ~ # ps | grep Ex
    5862144 vmm0:WindowsVista_Ex
    5911300 5837567 Worker#0:WindowsVista_Ex /bin/vmx
    ~ # kill -9 5862144
    ash: cannot kill pid 5862144: No such process
    ~ # kill -9 5911300
    ash: cannot kill pid 5911300: No such process
    ~ # kill -9 5837567
    ash: cannot kill pid 5837567: No such process
    ~ # esxtop
    ~ # kill -9 3426065
    ash: cannot kill pid 3426065: No such process
    my last resort is to format the Datastore in this case.

    any kind of suggestion would be greatly appreciated.

    thanks.

  • #2
    Re: Unable to delete VM directory from Datastore

    Do you believe the VM to still be running or associated with a process or world?

    Try the command:

    vm-support -x

    Is your rogue VM listed? If so, run the command:

    vm-support -X <VM number listed above>

    Notice the difference in case sensitivity on the -x switch between the two commands. This should debug and kill the VM in most instances although I've seen one instance where even this doesn't work.

    You can also try:

    ps -auxwww |grep <vm_name>

    Then kill -9 the first PID you see associated with the above command.

    Blowing away the datastore seems drastic. At the very least if the above commands don't work you should be able to reboot the host to resolve the issue.
    VCDX3 #34, VCDX4, VCDX5, VCAP4-DCA #14, VCAP4-DCD #35, VCAP5-DCD, VCPx4, vEXPERTx4, MCSEx3, MCSAx2, MCP, CCAx2, A+
    boche.net - VMware Virtualization Evangelist
    My advice has no warranties. Follow at your own risk.

    Comment


    • #3
      Re: Unable to delete VM directory from Datastore

      hm.. I'm still failed to kill it

      see the following Killing history ;-o)

      ~ # ps -ef | grep -i Windows
      ps: invalid option -- e
      ps: unknown option ?
      ps: invalid option -- f
      ps: unknown option ?
      5862144 vmm0:WindowsVista_Ex
      5911300 5837567 Worker#0:WindowsVista_Ex /bin/vmx
      ~ # kill 5862144
      ash: cannot kill pid 5862144: No such process
      ~ # kill
      ~ # ps -ef | grep -i 5911300
      ps: invalid option -- e
      ps: unknown option ?
      ps: invalid option -- f
      ps: unknown option ?
      5911300 5837567 Worker#0:WindowsVista_Ex /bin/vmx
      ~ # ps -ef | grep 5911300
      ps: invalid option -- e
      ps: unknown option ?
      ps: invalid option -- f
      ps: unknown option ?
      5911300 5837567 Worker#0:WindowsVista_Ex /bin/vmx
      ~ # ps | grep 5911300
      5911300 5837567 Worker#0:WindowsVista_Ex /bin/vmx
      ~ # ps | grep 5837567
      5837567 5837567 vmx /bin/vmx
      5911300 5837567 Worker#0:WindowsVista_Ex /bin/vmx
      ~ # kill 5911300
      ash: cannot kill pid 5911300: No such process
      ~ # ps | grep 5837567
      5837567 5837567 vmx /bin/vmx
      5911300 5837567 Worker#0:WindowsVista_Ex /bin/vmx
      ~ # kill 5837567
      ash: cannot kill pid 5837567: No such process
      ~ # ps | grep 5837567
      5837567 5837567 vmx /bin/vmx
      5911300 5837567 Worker#0:WindowsVista_Ex /bin/vmx
      ~ # ps | grep 5837567
      5837567 5837567 vmx /bin/vmx
      5911300 5837567 Worker#0:WindowsVista_Ex /bin/vmx
      ~ #

      Comment


      • #4
        Re: Unable to delete VM directory from Datastore

        As Mr. Boche suggested, as a last effort have you tried rebooting the ESX host?
        Or is that out of the question?

        Comment


        • #5
          Re: Unable to delete VM directory from Datastore

          Unfortunately trying to remove the Datastore is also not going well.

          Code:
          Remove datastore
          The resource vim.host.DatastoreSystem ESXi01-local_VMFS is in use.
          rebooting the host at the moment is not an option as i have to schedule it in quite long time as there re 32 VMs running from the SAN through this host.

          Comment


          • #6
            Re: Unable to delete VM directory from Datastore

            I've had similar frustrating situations. I'm sure there is some way to track down every remnant of a VM process, but I have yet to figure it out.

            I'm guessing there's no like host that you can Vmotion all the running VMs to?

            Also I notice you used "ps -ef" I tend to always use that as well, but give Mr. Boche's suggestion a try and use "ps -auxwww |grep <vm_name>"

            Those options often reveal a bit more.

            Comment


            • #7
              Re: Unable to delete VM directory from Datastore

              Hi Resinblade,

              see the following command history that I went through, it is still to no satisfying result.

              ~ # ps -auxwww | grep WindowsVista_Ex
              ps: invalid option -- a
              ps: unknown option ?
              ps: invalid option -- x
              ps: unknown option ?
              ps: invalid option -- w
              ps: unknown option ?
              ps: invalid option -- w
              ps: unknown option ?
              ps: invalid option -- w
              ps: unknown option ?
              5911300 5837567 Worker#0:WindowsVista_Ex /bin/vmx
              ~ # kill -9 5911300
              ash: cannot kill pid 5911300: No such process
              ~ # kill -9 5837567
              ash: cannot kill pid 5837567: No such process
              ~ # ps -ef | grep WindowsVista_Ex
              ps: invalid option -- e
              ps: unknown option ?
              ps: invalid option -- f
              ps: unknown option ?
              5862144 vmm0:WindowsVista_Ex
              5911300 5837567 Worker#0:WindowsVista_Ex /bin/vmx
              ~ # kill -9 5862144
              ash: cannot kill pid 5862144: No such process
              ~ #
              I've tried to delete the local datastore but it failed as well, this is the only thing in the local SATA_Datastore.

              is there any way to do it perhaps as rebooting the ESXi host is the very last resort ?

              Comment


              • #8
                Re: Unable to delete VM directory from Datastore

                Interesting. I had thought that for the 'ps' BSD options that it didn't matter if a dash was present or not. Try "ps auxwww" instead. That should definitely work.

                Comment


                • #9
                  Re: Unable to delete VM directory from Datastore

                  tha's an incredibly high PID... 7 characters...
                  doesn't seem quite right.

                  have you tried vmware-cmd -s unregister /path/to/config.vmx ?
                  (for instance /vmfs/volumes/datastore1/machinename/machinename.vmx)
                  Please do show your appreciation to those who assist you by leaving Rep Point https://www.petri.com/forums/core/im.../icon_beer.gif

                  Comment

                  Working...
                  X