Solved

can't start the virtual machine through virtual manager on centOS 6.2

Posted on 2014-09-22
28
243 Views
Last Modified: 2014-10-04
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/alchemySnap | /bin/gzip | /bin/dd of=alchemy.OS20140920.dd.gz


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
0
Comment
Question by:Jason Yu
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 15
  • 11
28 Comments
 
LVL 62

Expert Comment

by:gheist
ID: 40338905
/boot partition is missing from system.
It does not boot LVM directly.
0
 

Author Comment

by:Jason Yu
ID: 40339660
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.
0
 
LVL 62

Accepted Solution

by:
gheist earned 500 total points
ID: 40339681
No, you backed up just LVM
Now you need to install basic CentOS and restore LVM volumes one by one (you have lvm config in /etc/ in one of volumes.
0
The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

 

Author Comment

by:Jason Yu
ID: 40339698
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.
0
 
LVL 62

Expert Comment

by:gheist
ID: 40339732
You need to edit lvm.conf inside on-disk initrd in /boot
And probably run fsck-s before moment of truth reboots.
0
 

Author Comment

by:Jason Yu
ID: 40340064
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.el6.x86_64.hmac
-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.x86_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.el6.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.x86_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]#
0
 
LVL 62

Expert Comment

by:gheist
ID: 40340217
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.
0
 

Author Comment

by:Jason Yu
ID: 40340258
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!!
0
 
LVL 62

Expert Comment

by:gheist
ID: 40340314
5a. run dracut -f to actualy plant lvm.conf into initrd.
0
 

Author Comment

by:Jason Yu
ID: 40340352
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.
0
 

Author Comment

by:Jason Yu
ID: 40340465
Hi, gheist:

Could you advise how to validate this backup? Do I need create a windows server 2008 for the recovery?

thanks.
0
 
LVL 62

Expert Comment

by:gheist
ID: 40340843
I hardly understand what you are saying.
What is not booting? Windows ir Linux? Which is guest and which is host?
0
 

Author Comment

by:Jason Yu
ID: 40342090
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.
0
 
LVL 62

Expert Comment

by:gheist
ID: 40342228
Maybe start by adding some windows areas.... Posting Linux file listings does not get windows anywhere....
0
 

Author Comment

by:Jason Yu
ID: 40348776
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.
0
 
LVL 62

Expert Comment

by:gheist
ID: 40348819
There is a simple problem - windows does not boot...
0
 

Author Comment

by:Jason Yu
ID: 40350714
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
0
 

Author Comment

by:Jason Yu
ID: 40350723
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.
0
 

Author Comment

by:Jason Yu
ID: 40350790
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.
0
 
LVL 62

Expert Comment

by:gheist
ID: 40350795
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.
0
 

Author Comment

by:Jason Yu
ID: 40350916
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.
0
 

Author Comment

by:Jason Yu
ID: 40350922
i didn't see the attached word file.

Here it is.
0
 
LVL 62

Expert Comment

by:gheist
ID: 40351095
If your system is unbootable as shut down that backup will not be any better. welcome to wonderful world of windows....
0
 

Author Comment

by:Jason Yu
ID: 40361489
ok, I will initiate a new post for this problem, thank you for your help anyway, Gheist.

I appreciate your help.
0
 
LVL 62

Expert Comment

by:gheist
ID: 40361576
You can ask to cancel this one.
1) your backup process is corredt
2) you know ways around XEN
Unbootable windows - sorry no idea...
0

Featured Post

Free NetCrunch network monitor licenses!

Only on Experts-Exchange: Sign-up for a free-trial and we'll send you your permanent license!

Here is what you get: 30 Nodes | Unlimited Sensors | No Time Restrictions | Absolutely FREE!

Act now. This offer ends July 14, 2017.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Background Information Recently I have fixed file server permission issues for one of my client. The client has 1800 users and one Windows Server 2008 R2 domain joined file server with 12 TB of data, 250+ shared folders and the folder structure i…
In this article, I am going to show you how to simulate a multi-site Lab environment on a single Hyper-V host. I use this method successfully in my own lab to simulate three fully routed global AD Sites on a Windows 10 Hyper-V host.
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
How to install and configure Citrix XenApp 6.5 - Part 1. In this video tutorial we have explained step by step installation of Citrix XenApp 6.5 Server on Windows Server 2008 R2 is explained in this video. We have explained the difference between…

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question