Jason Yu
asked on
can't start the virtual machine through virtual manager on centOS 6.2
I have backuped a virtual machine from one centOS6.3 system. I used the following procedure for backup.
1. First dump the xml file:
/usr/bin/virsh dumpxml AlchemyServer | cat > centaur.conf
2. backup the vg_os volume
/sbin/vgcfgbackup -f /u1/lvmSnap/centaur-OS.cfg vg_os
3. backup the vg_Data volume
/sbin/vgcfgbackup -f /u1/lvmSnap/$centaur-Data. cfg vg_Data
4. create a snapshot volume
/sbin/lvcreate -s -L 50G -n alchemySnap /dev/vg_Data/alchemy
5. start the vm
/usr/bin/virsh start AlchemyServer
6. backup the snapshot volume
/bin/dd if=/dev/vg_Data/alchemySna p | /bin/gzip | /bin/dd of=alchemy.OS20140920.dd.g z
Now I need recover this vm from the backup achieve file above, I first created a volume on the destination machine after I unzipped the archieve:
/sbin/lvcreate -L 50G -n alchemy /dev/data
Then I tried to enter the GUI by running virt-manager. However, when I am inside this interface, I don't know how to make the virtual machine. I tried to make the new virtual machine exactly the same as the original one, but when I boot it, it got the error.
virtual-machine-error.png
1. First dump the xml file:
/usr/bin/virsh dumpxml AlchemyServer | cat > centaur.conf
2. backup the vg_os volume
/sbin/vgcfgbackup -f /u1/lvmSnap/centaur-OS.cfg
3. backup the vg_Data volume
/sbin/vgcfgbackup -f /u1/lvmSnap/$centaur-Data.
4. create a snapshot volume
/sbin/lvcreate -s -L 50G -n alchemySnap /dev/vg_Data/alchemy
5. start the vm
/usr/bin/virsh start AlchemyServer
6. backup the snapshot volume
/bin/dd if=/dev/vg_Data/alchemySna
Now I need recover this vm from the backup achieve file above, I first created a volume on the destination machine after I unzipped the archieve:
/sbin/lvcreate -L 50G -n alchemy /dev/data
Then I tried to enter the GUI by running virt-manager. However, when I am inside this interface, I don't know how to make the virtual machine. I tried to make the new virtual machine exactly the same as the original one, but when I boot it, it got the error.
virtual-machine-error.png
ASKER
HI, Gheist:
Thank you very much for your reply. I have several questions.
did I backup boot partition when I was doing the backup?
I thought the backup archive include the boot partition. How could I recover the boot partition.
Thank you very much for your reply. I have several questions.
did I backup boot partition when I was doing the backup?
I thought the backup archive include the boot partition. How could I recover the boot partition.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Gheist:
Thank you for your reply. After I install a basic CentOS, how could I recover the LVM to the new host? Do I need add these old LVMs to the new host volume manager? And which file I need modify?
thanks a lot.
Thank you for your reply. After I install a basic CentOS, how could I recover the LVM to the new host? Do I need add these old LVMs to the new host volume manager? And which file I need modify?
thanks a lot.
You need to edit lvm.conf inside on-disk initrd in /boot
And probably run fsck-s before moment of truth reboots.
And probably run fsck-s before moment of truth reboots.
ASKER
On my source system, I didn't see a file named lvm.conf. Could you explain a bit more about it?
thanks.
[root@centaur vg_Data]# cd /boot
[root@centaur boot]# ls -alt | grep lvm
[root@centaur boot]# ls -alt
total 58905
dr-xr-xr-x. 28 root root 4096 Feb 26 2014 ..
-rw-r--r--. 1 root root 179204 Aug 14 2012 symvers-2.6.32-279.5.1.el6 .x86_64.gz
-rw-r--r--. 1 root root 101976 Aug 14 2012 config-2.6.32-279.5.1.el6. x86_64
-rw-r--r--. 1 root root 2341894 Aug 14 2012 System.map-2.6.32-279.5.1. el6.x86_64
-rw-r--r--. 1 root root 170 Aug 14 2012 .vmlinuz-2.6.32-279.5.1.el 6.x86_64.h mac
-rwxr-xr-x. 1 root root 3987088 Aug 14 2012 vmlinuz-2.6.32-279.5.1.el6 .x86_64
-rw-r--r--. 1 root root 171087 Dec 6 2011 symvers-2.6.32-220.el6.x86 _64.gz
-rw-r--r--. 1 root root 166 Dec 6 2011 .vmlinuz-2.6.32-220.el6.x8 6_64.hmac
-rwxr-xr-x. 1 root root 3938288 Dec 6 2011 vmlinuz-2.6.32-220.el6.x86 _64
-rw-r--r--. 1 root root 100943 Dec 6 2011 config-2.6.32-220.el6.x86_ 64
-rw-r--r--. 1 root root 2312369 Dec 6 2011 System.map-2.6.32-220.el6. x86_64
-rw-r--r--. 1 root root 23806163 May 4 2011 initramfs-2.6.32-279.5.1.e l6.x86_64. img
drwxr-xr-x. 2 root root 1024 May 4 2011 grub
dr-xr-xr-x. 5 root root 1024 May 4 2011 .
-rw-r--r--. 1 root root 23335550 May 4 2011 initramfs-2.6.32-220.el6.x 86_64.img
drwxr-xr-x. 3 root root 1024 May 4 2011 efi
drwx------. 2 root root 12288 May 4 2011 lost+found
[root@centaur boot]#
thanks.
[root@centaur vg_Data]# cd /boot
[root@centaur boot]# ls -alt | grep lvm
[root@centaur boot]# ls -alt
total 58905
dr-xr-xr-x. 28 root root 4096 Feb 26 2014 ..
-rw-r--r--. 1 root root 179204 Aug 14 2012 symvers-2.6.32-279.5.1.el6
-rw-r--r--. 1 root root 101976 Aug 14 2012 config-2.6.32-279.5.1.el6.
-rw-r--r--. 1 root root 2341894 Aug 14 2012 System.map-2.6.32-279.5.1.
-rw-r--r--. 1 root root 170 Aug 14 2012 .vmlinuz-2.6.32-279.5.1.el
-rwxr-xr-x. 1 root root 3987088 Aug 14 2012 vmlinuz-2.6.32-279.5.1.el6
-rw-r--r--. 1 root root 171087 Dec 6 2011 symvers-2.6.32-220.el6.x86
-rw-r--r--. 1 root root 166 Dec 6 2011 .vmlinuz-2.6.32-220.el6.x8
-rwxr-xr-x. 1 root root 3938288 Dec 6 2011 vmlinuz-2.6.32-220.el6.x86
-rw-r--r--. 1 root root 100943 Dec 6 2011 config-2.6.32-220.el6.x86_
-rw-r--r--. 1 root root 2312369 Dec 6 2011 System.map-2.6.32-220.el6.
-rw-r--r--. 1 root root 23806163 May 4 2011 initramfs-2.6.32-279.5.1.e
drwxr-xr-x. 2 root root 1024 May 4 2011 grub
dr-xr-xr-x. 5 root root 1024 May 4 2011 .
-rw-r--r--. 1 root root 23335550 May 4 2011 initramfs-2.6.32-220.el6.x
drwxr-xr-x. 3 root root 1024 May 4 2011 efi
drwx------. 2 root root 12288 May 4 2011 lost+found
[root@centaur boot]#
It is inside initramfs files. original is in one of LVM volumes as /etc/lvm/lvm.conf
You need to extract the file from LVM volume.
You need to extract the file from LVM volume.
ASKER
HI, Gheist:
You are right, there is a lvm.conf file on my source system, it's under /etc/lvm.
[root@centaur boot]# cd /etc/lvm
[root@centaur lvm]# ls -alt
total 56
drwx------. 2 root root 4096 Sep 22 14:52 backup
drwx------. 2 root root 4096 Sep 22 14:52 archive
drwxr-xr-x. 96 root root 4096 Aug 29 14:52 ..
drwxr-xr-x. 5 root root 4096 Jul 15 09:24 .
drwx------. 2 root root 4096 Jun 22 2012 cache
-rw-r--r--. 1 root root 34655 Jun 22 2012 lvm.conf
[root@centaur lvm]# vi lvm.conf
[root@centaur lvm]# pwd
/etc/lvm
[root@centaur lvm]# hostname
centaur.minkagroup.net
[root@centaur lvm]#
-------------------------- ---------- ------
So, my action plan is as below:
1. Reinstall the same CentOS on a virtual machine.
2. set up a volume group on the new build virtual machine.
3. use lvcreate command to make a new logical volume.
/sbin/lvcreate -L 80G -n alchemy /dev/data
4. Recover the logic volume from the backup archieve by using the following command:
/bin/dd of=alchemy.OS20140920.dd if=/dev/data/alchemy
5. copy the /etc/lvm/lvm.con from the source vm to the destination vm.
6. reboot the system.
Is the procedure correct for recovery, please help me by modifing it and give your suggestion.
I am new to virt-manager on redhat. Could you send me some links to learn it? I have used vmware for a long time but never used vm on this platform.
Thanks a lot, you are the best!!
You are right, there is a lvm.conf file on my source system, it's under /etc/lvm.
[root@centaur boot]# cd /etc/lvm
[root@centaur lvm]# ls -alt
total 56
drwx------. 2 root root 4096 Sep 22 14:52 backup
drwx------. 2 root root 4096 Sep 22 14:52 archive
drwxr-xr-x. 96 root root 4096 Aug 29 14:52 ..
drwxr-xr-x. 5 root root 4096 Jul 15 09:24 .
drwx------. 2 root root 4096 Jun 22 2012 cache
-rw-r--r--. 1 root root 34655 Jun 22 2012 lvm.conf
[root@centaur lvm]# vi lvm.conf
[root@centaur lvm]# pwd
/etc/lvm
[root@centaur lvm]# hostname
centaur.minkagroup.net
[root@centaur lvm]#
--------------------------
So, my action plan is as below:
1. Reinstall the same CentOS on a virtual machine.
2. set up a volume group on the new build virtual machine.
3. use lvcreate command to make a new logical volume.
/sbin/lvcreate -L 80G -n alchemy /dev/data
4. Recover the logic volume from the backup archieve by using the following command:
/bin/dd of=alchemy.OS20140920.dd if=/dev/data/alchemy
5. copy the /etc/lvm/lvm.con from the source vm to the destination vm.
6. reboot the system.
Is the procedure correct for recovery, please help me by modifing it and give your suggestion.
I am new to virt-manager on redhat. Could you send me some links to learn it? I have used vmware for a long time but never used vm on this platform.
Thanks a lot, you are the best!!
5a. run dracut -f to actualy plant lvm.conf into initrd.
ASKER
I got confused now.
My original host is a CentOS 6.3 box, the vm running on it is a windows server 20008 R2 which I have backed up.
Now, I want to verify if I can restore this vm from the backup archive file on another host. This host is a CentOS Release 6.2 box. Which OS should I install on the vm on the destination host? I think I should install a windows server 2008 R2 on the destination host, am I right?
I am sorry for the confusion, I hope I explain it clearly this time.
My original host is a CentOS 6.3 box, the vm running on it is a windows server 20008 R2 which I have backed up.
Now, I want to verify if I can restore this vm from the backup archive file on another host. This host is a CentOS Release 6.2 box. Which OS should I install on the vm on the destination host? I think I should install a windows server 2008 R2 on the destination host, am I right?
I am sorry for the confusion, I hope I explain it clearly this time.
ASKER
Hi, gheist:
Could you advise how to validate this backup? Do I need create a windows server 2008 for the recovery?
thanks.
Could you advise how to validate this backup? Do I need create a windows server 2008 for the recovery?
thanks.
I hardly understand what you are saying.
What is not booting? Windows ir Linux? Which is guest and which is host?
What is not booting? Windows ir Linux? Which is guest and which is host?
ASKER
the host is a centos 6.2 machine, the gust is a windows 2008 os. The guest is not booting after allocated the recovered lvm as the primary disk.
Maybe start by adding some windows areas.... Posting Linux file listings does not get windows anywhere....
ASKER
I am sorry I didn't get the solution yet.
I have made a backup of a virtual machine (this vm is a windows 2008 r2 vm). I want to restore it on another Redhat OS host. But I don't know how to do it.
Any help will be great appreciated. thanks.
I have made a backup of a virtual machine (this vm is a windows 2008 r2 vm). I want to restore it on another Redhat OS host. But I don't know how to do it.
Any help will be great appreciated. thanks.
There is a simple problem - windows does not boot...
ASKER
Hi, Guys:
I really need some help for this issue.
I backed up the virtual machine's first disk yeasterday and tried to recover it again on another CentOS host, it failed again.
It shows the same error message: "No bootable device"
I don't understand: I backed up the OS partition from the original vm, and recover it to a new lvm on the destination host, why it can't start the machine. Is there a trick settings for reboot from "C" partition?
Any help will be great appreciated.
Thank you.
can-t-reboot.png
two-vms-comparison.png
I really need some help for this issue.
I backed up the virtual machine's first disk yeasterday and tried to recover it again on another CentOS host, it failed again.
It shows the same error message: "No bootable device"
I don't understand: I backed up the OS partition from the original vm, and recover it to a new lvm on the destination host, why it can't start the machine. Is there a trick settings for reboot from "C" partition?
Any help will be great appreciated.
Thank you.
can-t-reboot.png
two-vms-comparison.png
ASKER
Here I am uploading the manual I got from the predecessor.
Unfortunately, he didn't talk about too much detail about how to recover the vm on a new LVM.
Please help. thanks.
Unfortunately, he didn't talk about too much detail about how to recover the vm on a new LVM.
Please help. thanks.
ASKER
I made a word document recording all i have done to recover this vm, gheist, could you please take a look at the step by step explanation?
Thanks.
Thanks.
I am of very little help with broken windows.
If your question outlines backup procedure then it is only valid for powered off VM. There is no telling in what state it was when you did volume group snapshots etc.
If your question outlines backup procedure then it is only valid for powered off VM. There is no telling in what state it was when you did volume group snapshots etc.
ASKER
I used this procedure to backup the vm, I suppose the vm was powered off when I was doing the dd command.
1. shutdown vm: /usr/bin/virsh shutdown AlchemyServer
2. create a new lvm
/sbin/lvcreate -s -L $vmSnapSize -n $vmSnap $lvmPath/$lvmName
3. use dd command to backup the lvm
/bin/dd if=$lvmPath/$vmSnap | /bin/gzip | /usr/bin/ssh -i $key $bkUser@$bkHost /bin/dd of=$vm/$vmShort.OS$d8t.dd. gz
then I used these commands to recover the vm:
/sbin/lvcreate -s -L 70G -n alchemySnap /dev/data/alchemy
Then write back to the new created lvm from the archive file.
/bin/dd of=alchemy.OS20140920.dd if=/dev/data/alchemy
After this, I used the "virtual manager" to recover the vm.
1. shutdown vm: /usr/bin/virsh shutdown AlchemyServer
2. create a new lvm
/sbin/lvcreate -s -L $vmSnapSize -n $vmSnap $lvmPath/$lvmName
3. use dd command to backup the lvm
/bin/dd if=$lvmPath/$vmSnap | /bin/gzip | /usr/bin/ssh -i $key $bkUser@$bkHost /bin/dd of=$vm/$vmShort.OS$d8t.dd.
then I used these commands to recover the vm:
/sbin/lvcreate -s -L 70G -n alchemySnap /dev/data/alchemy
Then write back to the new created lvm from the archive file.
/bin/dd of=alchemy.OS20140920.dd if=/dev/data/alchemy
After this, I used the "virtual manager" to recover the vm.
ASKER
i didn't see the attached word file.
Here it is.
Here it is.
If your system is unbootable as shut down that backup will not be any better. welcome to wonderful world of windows....
ASKER
ok, I will initiate a new post for this problem, thank you for your help anyway, Gheist.
I appreciate your help.
I appreciate your help.
You can ask to cancel this one.
1) your backup process is corredt
2) you know ways around XEN
Unbootable windows - sorry no idea...
1) your backup process is corredt
2) you know ways around XEN
Unbootable windows - sorry no idea...
It does not boot LVM directly.