Restore of VPS with mounted logical volume (LVM) [message #38318] |
Sun, 06 December 2009 00:51 |
Leandro Anthonioz
Messages: 5 Registered: May 2008
|
Junior Member |
|
|
Hi, I'm using OpenVz in Debian Lenny, kernel 2.6.26-2-openvz-686 and I have a problem with checkpointing/restore functionality. Maybe somebody can help me.
I create a VPS and a LVM logical volume. Then, I put the logical volume inside VPS, format it and mount it. Then, I do a VPS checkpoint, ok. When I attempt to restore VPS, i have an error "Error: undump failed: No such file or directory". If I unmount the volume BEFORE checkpoint VPS, restore works ok, but I need restore VPS with volume ALREADY mounted.
This is exactly what I do:
# Create a new VPS and a new LVM logical volume
vzctl create 100
lvcreate --size 1G --name vol-new /dev/vg0
# "Put" the logical volume inside VPS
vzctl set 100 --devnodes vg0/vol-new:rw --save
# Enter to VPS
vzctl start 100
vzctl enter 100
# Format logical volume, mount it and save a file
mkfs -t ext3 /dev/vg0/vol-new
mkdir /mnt/volume
mount /dev/vg0/vol-new /mnt/volume
nano /mnt/volume/Hello.txt
# Exit to HN
exit
# Checkpoint VPS
vzctl chkpnt 100 --suspend
vzctl chkpnt 100 --dump --dumpfile /vz/dump/100.dump
vzctl chkpnt 100 --kill
# Attempt to restore VPS (in same HN)
vzctl restore 100 --undump --dumpfile /vz/dump/100.dump
# Last command output:
Restoring VE ...
Starting VE ...
VE is mounted
undump...
Setting CPU units: 1000
Setting devices
Configure meminfo: 65536
Error: undump failed: No such file or directory
Restoring failed:
Error: -2 mounting /mnt/volume ext3 40000000
Error: rst_namespace: -2
VE start failed
Stopping VE ...
VE was stopped
VE is unmounted
I was reading about mount scripts (100.mount), but I couldn't solve this problem. What is wrong?
Any help will be very appreciate it. Thank you!
|
|
|
|
Re: Restore of VPS with mounted logical volume (LVM) [message #38897 is a reply to message #38318] |
Wed, 17 February 2010 01:44 |
Leandro Anthonioz
Messages: 5 Registered: May 2008
|
Junior Member |
|
|
Hi all, I still cann't solve this problem. I download vzctl source code and debug it with gdb and DDD, but code is difficult to interpret for me (I'm not a kernel hacker ;D).
After that, I use strace and found this:
----------------------
stat64("/etc/vz/conf/100.start", 0xbfc83f74) = -1 ENOENT (No such file or directory)
close(10) = 0
read(11, Error: undump failed: No such file or directory
Restoring failed:
Error: -2 mounting /mnt/volume ext3 40000000
Error: rst_namespace: -2
----------------------
According first line, seems that vzctl needs (in this case) a start script (100.start), but I cann't understand why. Well, I wrote 100.start script without any code (only "#!/bin/bash" and an "echo" command) an next attempt to do restore, I get this:
----------------------
Restoring VE ...
Starting VE ...
VE is mounted
undump...
Setting CPU units: 1000
Setting devices
Configure meminfo: 65536
VE start failed
Stopping VE ...
get context...
VE was stopped
VE is unmounted
----------------------
After create 100.start script, error "No such file or directory" disappears. However, I cann't restore VPS yet. What code I need write in 100.start script?
Any help will be greatly appreciated. Thank you very much!
|
|
|
|
|