Solved

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

Posted on 2014-09-22
28
235 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
  • 15
  • 11
28 Comments
 
LVL 61

Expert Comment

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

Author Comment

by:Jason Yu
Comment Utility
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 61

Accepted Solution

by:
gheist earned 500 total points
Comment Utility
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
 

Author Comment

by:Jason Yu
Comment Utility
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 61

Expert Comment

by:gheist
Comment Utility
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
Comment Utility
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 61

Expert Comment

by:gheist
Comment Utility
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
Comment Utility
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 61

Expert Comment

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

Author Comment

by:Jason Yu
Comment Utility
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
Comment Utility
Hi, gheist:

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

thanks.
0
 
LVL 61

Expert Comment

by:gheist
Comment Utility
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
Comment Utility
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 61

Expert Comment

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

Author Comment

by:Jason Yu
Comment Utility
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 61

Expert Comment

by:gheist
Comment Utility
There is a simple problem - windows does not boot...
0
 

Author Comment

by:Jason Yu
Comment Utility
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
Comment Utility
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
Comment Utility
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 61

Expert Comment

by:gheist
Comment Utility
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
Comment Utility
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
Comment Utility
i didn't see the attached word file.

Here it is.
0
 

Author Comment

by:Jason Yu
Comment Utility
0
 
LVL 61

Expert Comment

by:gheist
Comment Utility
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
Comment Utility
ok, I will initiate a new post for this problem, thank you for your help anyway, Gheist.

I appreciate your help.
0
 
LVL 61

Expert Comment

by:gheist
Comment Utility
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

#Citrix #XenApp #Citrix Scout #Citrix Insight Services #Microsoft VMMAP #Microsoft ADEXPLORE #Microsoft RAMMAP #Microsoft TCPVIEW #Microsoft AUTORUNS #Microsoft PROCESS EXPLORER #Microsoft PROCESS MONITOR
VMware Update Manager(VUM) “error code: 15” during ESXi 6.0 Remediate update in VUM operation
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

762 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now