Results 1 to 13 of 13
  1. #1
    Join Date
    Dec 2009
    Location
    Dubai
    Posts
    353

    Accidental deletion of a VM in VMware

    Hello

    I have accidentally deleted files of a running VM in VMware. Firtunately disk files could not be deleted as they were busy. I have the following files there:

    Saeed-flat.vmdk
    Saeed.vmx.lck
    vmx-Saeed-407251372-1.vswp
    Saeed-184629ac.vswp

    How can I restore the VM using these files?

    Thanks in advance.

  2. #2
    Join Date
    Dec 2012
    Location
    Internet
    Posts
    160
    i think you can't restore it . . .

  3. #3
    Once it's gone that's it.

  4. #4
    Join Date
    Feb 2012
    Location
    Memphis, TN
    Posts
    2,978
    If you deleted files then you would need to restore your backup.

    Unfortunately with no backup available you are out of luck.
    hostingcove.com | Tennessee Based Hosting Provider.
    cPanel Shared & Reseller Hosting - Domain Names
    Join thousands of happy customers. Secure & Stable
    HeroicVPS Premium KVM VPS. Ashburn / Phoenix

  5. #5
    Join Date
    Dec 2009
    Location
    Dubai
    Posts
    353
    But I think config files are lost and disk files are there so there should be a way to restore/recreate config files. Not?

  6. #6
    Join Date
    Jul 2009
    Location
    In the Datacenter.
    Posts
    127
    Correct - if the image is still in tact, then just create a new VM and mount it. You already know the answer to your own question.

    Then as mentioned, get on to some thing like Veam to handle your backups.
    SonicVPS.com - Automated VPS Provisioning

  7. #7
    Join Date
    May 2009
    Location
    SLASH ROOT
    Posts
    853

  8. #8
    Join Date
    May 2009
    Location
    SLASH ROOT
    Posts
    853

  9. #9
    Join Date
    May 2007
    Location
    Bhopal - India
    Posts
    331
    The only file needed is vmdk which you already have, just recreate a new vps and use existing vhd.
    LoopByte
    India Based Dedicated Servers, VPS & Hosting Services

  10. #10
    Join Date
    Mar 2010
    Location
    Germany
    Posts
    681
    Quote Originally Posted by pijaweb View Post
    Hello

    I have accidentally deleted files of a running VM in VMware. Firtunately disk files could not be deleted as they were busy. I have the following files there:

    Saeed-flat.vmdk
    Saeed.vmx.lck
    vmx-Saeed-407251372-1.vswp
    Saeed-184629ac.vswp

    How can I restore the VM using these files?

    Thanks in advance.
    Since you still have the vmdk, create a new vm, and attach the vmdk.
    I'm a bit surprised the .vmx is deleted and the lock is there, but anyway.

    If you're doing it carefully,
    - first copy it
    - then boot it to single user first and extract the original NIC mac address from the VMs config files (/etc/udev/rules.d/70-persistent-net-rules).
    But normally it doesn't matter.

    Anyway be careful and hope you get it back.

  11. #11
    Join Date
    Dec 2009
    Location
    Dubai
    Posts
    353
    I have fixed. Simply created a new VM. Then logged into ESXi host via SSH, deleted the new VM's *-flat.vmdk file. Then copied the old flat.vmdk file to the directory of new VM and renamed it to match the new VM's name and at last renamed the new VM to old one from Vi client.

  12. #12
    Join Date
    Jun 2005
    Posts
    3,448
    Quote Originally Posted by pijaweb View Post
    I have fixed. Simply created a new VM. Then logged into ESXi host via SSH, deleted the new VM's *-flat.vmdk file. Then copied the old flat.vmdk file to the directory of new VM and renamed it to match the new VM's name and at last renamed the new VM to old one from Vi client.
    Its great that you posted back the solution.

    Things like this should be a way of the universe telling you "do backups" as next time you may not be that lucky.

  13. #13
    Join Date
    Nov 2005
    Location
    Nassau, The Bahamas
    Posts
    74
    Great job recovering from it!

    You should consider using Veeam or even VMware snapshots to backup your VM's in the future.
    Secure Hosting | Premium Cloud & Dedicated hosting solutions since 2001
    email: sales(at)securehost(dot)com +1-242-502-8700 24/7 support by phone/helpdesk
    Located in The Bahamas & Bermuda: Redundant Cooling, Power & Network, PCI DSS compliant, 7ms from USA

Similar Threads

  1. Accidental recursive chown
    By Zaggs in forum Hosting Security and Technology
    Replies: 12
    Last Post: 11-12-2009, 04:39 PM
  2. accidental chmod on bin, please help
    By insomne3065 in forum Hosting Security and Technology
    Replies: 4
    Last Post: 10-13-2006, 06:33 PM
  3. quick help! accidental deletion of files
    By web_mann23 in forum Web Hosting Lounge
    Replies: 9
    Last Post: 12-11-2005, 09:19 PM
  4. Just for Fun: The Story of an Accidental Revolutionary
    By hendricknet in forum Web Hosting Lounge
    Replies: 2
    Last Post: 10-20-2003, 08:42 AM
  5. Accidental Ad clicking
    By AcuNett in forum Web Hosting Lounge
    Replies: 5
    Last Post: 04-30-2002, 10:19 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •