Anyway to restore lost VM?

C

christy123

Guest
I noticed " no space left on device" when i tried to launch consoles of one of the Vms today . I couldnt reach my support person, i decided to reboot the server( i dont have a tech back ground".when i rebooted, i noticed of the vms showed on the interface except this one . My support person was able to fix the "no space left error" but was not able to find the current image of this lost vm. is there hope left or is this vm gone for ever? I have really important information on this machine.

we are using version 2

thanks you very much
 
Last edited by a moderator:
ok ..i have another question --does the restore delete prior versions of the image if the image was unmounted or deleted?
 
thank you ! i actually wanted to ask if the restore will "overwrite" not "delete".

Also, what would be the best way to search for the "lost vm". we tried foremost withthout luck.

thanks
 
Last edited by a moderator:
update....we were able to locate some deleted files in the same folder that hosts the restored image. Although there is some hope now that we can recover the lost data but would definitely prefer to image we lost.

any help will be appreciated. specifically, we would like to know which folder would have the lost image.

thank you
 
update....we were able to locate some deleted files in the same folder that hosts the restored image. Although there is some hope now that we can recover the lost data but would definitely prefer to image we lost.

any help will be appreciated. specifically, we would like to know which folder would have the lost image.

thank you
Hi,
it's not clear for me which data are gone. Do you look for an hdd-image of an kvm-VM? Which kind of image does the VM use? qcow2 or raw on local-storage or do you have an deleted logical volume?

Is the config of the VM also lost? Or only the config??

Udo
 
Hi Udo,

we basically started getting " no space left on device" error. during the process of resolving space issue, we booted the server a couple of times. After we resolved the issue, we noticed that one of the Vms( out of 10) was missing. when we couldnt locate the vm. we ended up restoring the vm from a backup. unfortunately, the backup was from august. Subsequently, we were able to find another image ( we believe this is the current image). however, this image doesnt boot. the format is VMDK. Right now we have two images 102-disk-1.vmdk ( we believe this is the original image -? corrupted or partially deleted). and 102-disk-2.vmdk( this the restored version of august backup). With photorec, we were able to see some recent data in 102-disk-2.vmdk. We think restoration might have deleted the original ( live ) image. However, the vm was not mounted ( not seen in proxmox interface) at the time of restoration.

The original config file is there but the vm doesnt boot with this config file anymore( we noticed some syntax changes. we did a recent version upgrade). Lvm is not corrupted or deleted.

Finally, does anyone know how to mount a vmware image on linux?


thanks for your response
 
Hi Udo,

we basically started getting " no space left on device" error. during the process of resolving space issue, we booted the server a couple of times. After we resolved the issue, we noticed that one of the Vms( out of 10) was missing. when we couldnt locate the vm. we ended up restoring the vm from a backup. unfortunately, the backup was from august. Subsequently, we were able to find another image ( we believe this is the current image). however, this image doesnt boot. the format is VMDK. Right now we have two images 102-disk-1.vmdk ( we believe this is the original image -? corrupted or partially deleted). and 102-disk-2.vmdk( this the restored version of august backup). With photorec, we were able to see some recent data in 102-disk-2.vmdk. We think restoration might have deleted the original ( live ) image. However, the vm was not mounted ( not seen in proxmox interface) at the time of restoration.

The original config file is there but the vm doesnt boot with this config file anymore( we noticed some syntax changes. we did a recent version upgrade). Lvm is not corrupted or deleted.

Finally, does anyone know how to mount a vmware image on linux?


thanks for your response
Hi,
please post the original config. With this info I can give you some hints to try an recover.

But you wrote: "102-disk-2.vmdk( this the restored version of august backup)" and " we were able to see some recent data in 102-disk-2.vmdk".
This don't fit!! How you can see recent data in an volume from august??

Udo
 
here is the old config file

ostype: w2k8
memory: 12288
sockets: 1
onboot: 1
name: ECW_Server_ _172.16.10.49
vlan0: e1000=9A:56:B8:61:F0:DE
bootdisk: ide0
ide0: local:102/vm-102-disk-1.vmdk
cores: 4
ide1: cdrom,media=cdrom
boot: cd
freeze: 0
cpuunits: 1000
acpi: 1
kvm: 1
#hostusb: 051d:0002
------------------------------------------------------------------------
this is the current file

#hostusb%3A 051d%3A0002
acpi: 1
boot: cd
bootdisk: ide0
cores: 4
cpuunits: 1000
freeze: 0
ide0: local:102/vm-102-disk-2.vmdk,format=vmdk
ide1: local:102/vm-102-disk-1.vmdk,format=vmdk
ide2: none,media=cdrom
kvm: 1
memory: 12288
name: ECW
net0: e1000=9A:56:B8:61:F0:DE,bridge=vmbr0
onboot: 1
ostype: w2k8 sockets: 1
-----------------------------------------------------------------------

Hi,
please post the original config. With this info I can give you some hints to try an recover.

But you wrote: "102-disk-2.vmdk( this the restored version of august backup)" and " we were able to see some recent data in 102-disk-2.vmdk".
This don't fit!! How you can see recent data in an volume from august??

Udo
 
I think your problems relates to this:
Before:
bootdisk: ide0
ide0: local:102/vm-102-disk-1.vmdk

Now:
bootdisk: ide0
ide0: local:102/vm-102-disk-2.vmdk,format=vmdk
ide1: local:102/vm-102-disk-1.vmdk,format=vmdk

You are booting on the wrong disk. Simply change boot disk to ide1 and you should be running again;-)

 
Thank you Mir!


we already tried that....it mounts disk 1 but doesnt boot. it seems disk 1 is corrupted

here is the old config file

ostype: w2k8
memory: 12288
sockets: 1
onboot: 1
name: ECW_Server_ _172.16.10.49
vlan0: e1000=9A:56:B8:61:F0:DE
bootdisk: ide0
ide0: local:102/vm-102-disk-1.vmdk
cores: 4
ide1: cdrom,media=cdrom
boot: cd
freeze: 0
cpuunits: 1000
acpi: 1
kvm: 1
#hostusb: 051d:0002
------------------------------------------------------------------------
this is the current file

#hostusb%3A 051d%3A0002
acpi: 1
boot: cd
bootdisk: ide0
cores: 4
cpuunits: 1000
freeze: 0
ide0: local:102/vm-102-disk-2.vmdk,format=vmdk
ide1: local:102/vm-102-disk-1.vmdk,format=vmdk
ide2: none,media=cdrom
kvm: 1
memory: 12288
name: ECW
net0: e1000=9A:56:B8:61:F0:DE,bridge=vmbr0
onboot: 1
ostype: w2k8 sockets: 1
-----------------------------------------------------------------------
 
here is the old config file

ostype: w2k8
memory: 12288
sockets: 1
onboot: 1
name: ECW_Server_ _172.16.10.49
vlan0: e1000=9A:56:B8:61:F0:DE
bootdisk: ide0
ide0: local:102/vm-102-disk-1.vmdk
cores: 4
ide1: cdrom,media=cdrom
boot: cd
freeze: 0
cpuunits: 1000
acpi: 1
kvm: 1
#hostusb: 051d:0002
------------------------------------------------------------------------
this is the current file

#hostusb%3A 051d%3A0002
acpi: 1
boot: cd
bootdisk: ide0
cores: 4
cpuunits: 1000
freeze: 0
ide0: local:102/vm-102-disk-2.vmdk,format=vmdk
ide1: local:102/vm-102-disk-1.vmdk,format=vmdk
ide2: none,media=cdrom
kvm: 1
memory: 12288
name: ECW
net0: e1000=9A:56:B8:61:F0:DE,bridge=vmbr0
onboot: 1
ostype: w2k8 sockets: 1
-----------------------------------------------------------------------
Hi,
can you see all actual stuff on ide1 (I guess D:\)?

To try an recover you need free space (size of the VM-disk). If you don't have VM 199 try something like this (shutdown VM102 first!):
Code:
mkdir /var/lib/vz/images/199
# convert to raw (if there are trouble with vmdk-format)
qemu-img  convert -O raw /var/lib/vz/images/102/vm-102-disk-1.vmdk /var/lib/vz/images/199/vm-199-disk-1.raw
file /var/lib/vz/images/199/vm-199-disk-1.raw

# write config file
cat << 'eof' > /etc/pve/qemu-server/199.conf
ostype: w2k8
memory: 12288
sockets: 1
onboot: 1
name: ECW-Server-recover
net0: e1000=9A:56:B8:61:F0:0E,bridge=vmbr0
bootdisk: ide0
ide0: local:199/vm-199-disk-1.raw
cores: 4
ide1: cdrom,media=cdrom
boot: cd
freeze: 0
cpuunits: 1000
acpi: 1
kvm: 1
eof

# now start the VM
qm start 199
If the image is corrupt, you should see error messages during convertion.

Udo
 
Hi Udo,

we tried what you suggested. we didnt see any errors during conversion. but it didnt work. we got the same response as before...on console it said " booting from hard drive" ..it never boots up though
 
Hi Udo,

we tried what you suggested. we didnt see any errors during conversion. but it didnt work. we got the same response as before...on console it said " booting from hard drive" ..it never boots up though

Hi,
and what shows
Code:
fdisk -l /var/lib/vz/images/199/vm-199-disk-1.raw
You don't answer, if you can see recent data on D:\ from the actual running VM.


Udo
 
Hi,
and what shows
Code:
fdisk -l /var/lib/vz/images/199/vm-199-disk-1.raw


You don't answer, if you can see recent data on D:\ from the actual running VM.


Udo

fdisk response

Disk /var/lib/vz/images/199/vm-199-disk-1.raw: 859.0 GB, 858993459200 bytes
255 heads, 63 sectors/track, 104433 cylinders, total 1677721600 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x992bec17

Device Boot Start End Blocks Id System
/var/lib/vz/images/199/vm-199-disk-1.raw1 * 2048 206847 102400 7 HPFS/NTFS/exFAT
/var/lib/vz/images/199/vm-199-disk-1.raw2 206848 102399999 51096576 7 HPFS/NTFS/exFAT
/var/lib/vz/images/199/vm-199-disk-1.raw3 102400000 1677719551 787659776 7 HPFS/NTFS/exFAT
-------------------------------------

yes we saw recent data in disk 2 with photorec recovered files

thanks
 
fdisk response

Disk /var/lib/vz/images/199/vm-199-disk-1.raw: 859.0 GB, 858993459200 bytes
255 heads, 63 sectors/track, 104433 cylinders, total 1677721600 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x992bec17

Device Boot Start End Blocks Id System
/var/lib/vz/images/199/vm-199-disk-1.raw1 * 2048 206847 102400 7 HPFS/NTFS/exFAT
/var/lib/vz/images/199/vm-199-disk-1.raw2 206848 102399999 51096576 7 HPFS/NTFS/exFAT
/var/lib/vz/images/199/vm-199-disk-1.raw3 102400000 1677719551 787659776 7 HPFS/NTFS/exFAT
-------------------------------------

yes we saw recent data in disk 2 with photorec recovered files

thanks

Hi,
looks not bad - have you tried to use fsck?

And I don't realy understand photorec - if I see it's right, during the action "create free space on /var/lib/vz" VM 102 was simply switched off (I assume the vmdk is and fat-vmdk (e.g. the vmdk-file allocate the whole space?) - otherwise perhaps the VM can't store more Data because of disk full...)?! And now something wrong with the filesystem/bootloader?


Udo
 
we mounted it as a secondary drive on a windows machine...it read the drive as raw...windows ran chkdsk at startup ... after that we were able to see folders on OS partition ( C drive) but chkdsk couldnt fix drive D which has data folders. we ran several recovery tools....these tools recover files from C drive but not from D.

At this point , we have a few concerns.
- if original conf file had only disk 1 in....where did the disk 2 come from.
- does restore function rename the disk during the restore process? Did he keep disk 1 as is and renamed disk 1 to disk 2 as it was restoring image from backup
- does restore completely overwrite the existing image if the vm is off line

thanks very much for your help.



Hi,
looks not bad - have you tried to use fsck?

And I don't realy understand photorec - if I see it's right, during the action "create free space on /var/lib/vz" VM 102 was simply switched off (I assume the vmdk is and fat-vmdk (e.g. the vmdk-file allocate the whole space?) - otherwise perhaps the VM can't store more Data because of disk full...)?! And now something wrong with the filesystem/bootloader?


Udo
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!