Re: recovery of virtual machines on KVM

2011-02-12 Thread Tapas Mishra
On Thu, Feb 10, 2011 at 4:39 AM, Ahmed Kamal ahmed.ka...@canonical.com wrote:
 On 02/09/2011 08:39 PM, Tapas Mishra wrote:

 I  am having a virtualization setup via KVM on a Ubuntu 10.04 64 bit
 server.

 A recent dbus update cause a crash of my Host OS.It was a post install
 script of dbus which ultimately brought everything down.

 Now I have to basically format the host OS.My cause of concern are the
 virtual machines which were running on it when the environment was
 stable.Which were in separate LVM partitions.

 Some thing like

 /dev/virtualization/vm1
 /dev/virtualization/vm2
 /dev/virtualization/vm3
 /dev/virtualization/vm4
 If some one has experienced recovery of this sort in past let me know
 what did they do to get things back. All my Virtual Machines were on
 separate partition and in same VolumeGroup this volume group was on
 Host OS. Will formatting of HOST os clear the Virtual Machines also in
 my situation or just be re installing the host and importing the
 Virtual Machines via a tool such as virt-manager I will be able to get
 them back.

 It depends, if the VG is stored on the same disk and you reinstall you might
 indeed destroy the VMs. Please don't proceed until you're sure of what
 you're doing


Well I can not escape from restoring the production environment Ahmed.

How ever by the time of writing this message I have restored every thing.
I am sharing it here might help some one who are into similar mess.

When you insert the Ubuntu CD it will ask you for partitioning schemes
chose the guided partitioning scheme  what you have to make sure is
not to format the volume group on which all the virtual machines
reside.

While creating these guests their locations were
/etc/libvirt/qemu/*.xml

To restore the Virtual Machine go to the /etc/libvirt/ directory of
USB backup and which ever file  you find missing on the fresh install
copy it after you have copied them

virsh define /path/to/vm.xml to define that VM in new environment (you
will see the VM might run without this but it is
advisable to do above thing)
My problem was a bit more difficult as the back I had was even buggy
so the restoration did not  went very smooth.When  you are restoring
the VMs then I noticed  some how permissions andsoftlinks had
broken.

Once you have finished copying the virtual machines permissions of
xml files in
/etc/libvirt/qemu/
should be changed to 644 any other file if you see has permission 777
needs to be 644 but the
same does not applies to directories.

When this was not there I noticed surprisingly the ssh connections to
the VMs after copying the   respective XML files back were dropping.By
the time I wrote down this it was confirmed the backup I had
permissions problem.

Files  in /etc/libvirt/qemu/*.xml on backup had permissions 777

where in the correct permissions should be 700 for these XMLs.
I want to mention 2 links if some comes across this thread should help them

https://www.redhat.com/archives/virt-tools-list/2011-February/msg00074.html

by changing the above xml files permission I observed our SSH
connection drop problem also got resolved.
How ever due to a DNS resolution failure the DomU social was failing
to restart many teams after each reboot of Dom0.So I had to manually
login and start it.
By  now I have successfully restored all the environment.



https://www.redhat.com/archives/virt-tools-list/2011-February/msg00060.html

-- 
ubuntu-server mailing list
ubuntu-server@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server
More info: https://wiki.ubuntu.com/ServerTeam


Re: recovery of virtual machines on KVM

2011-02-12 Thread Tapas Mishra
On Sat, Feb 12, 2011 at 10:15 PM, Tapas Mishra mightydre...@gmail.com wrote:
 On Thu, Feb 10, 2011 at 4:39 AM, Ahmed Kamal ahmed.ka...@canonical.com 
 wrote:
 On 02/09/2011 08:39 PM, Tapas Mishra wrote:

 I  am having a virtualization setup via KVM on a Ubuntu 10.04 64 bit
 server.

 A recent dbus update cause a crash of my Host OS.It was a post install
 script of dbus which ultimately brought everything down.

 Now I have to basically format the host OS.My cause of concern are the
 virtual machines which were running on it when the environment was
 stable.Which were in separate LVM partitions.

 Some thing like

 /dev/virtualization/vm1
 /dev/virtualization/vm2
 /dev/virtualization/vm3
 /dev/virtualization/vm4
 If some one has experienced recovery of this sort in past let me know
 what did they do to get things back. All my Virtual Machines were on
 separate partition and in same VolumeGroup this volume group was on
 Host OS. Will formatting of HOST os clear the Virtual Machines also in
 my situation or just be re installing the host and importing the
 Virtual Machines via a tool such as virt-manager I will be able to get
 them back.

 It depends, if the VG is stored on the same disk and you reinstall you might
 indeed destroy the VMs. Please don't proceed until you're sure of what
 you're doing


 Well I can not escape from restoring the production environment Ahmed.

 How ever by the time of writing this message I have restored every thing.
 I am sharing it here might help some one who are into similar mess.

 When you insert the Ubuntu CD it will ask you for partitioning schemes
 chose the guided partitioning scheme  what you have to make sure is
 not to format the volume group on which all the virtual machines
 reside.

 While creating these guests their locations were
 /etc/libvirt/qemu/*.xml

 To restore the Virtual Machine go to the /etc/libvirt/ directory of
 USB backup and which ever file  you find missing on the fresh install
 copy it after you have copied them

 virsh define /path/to/vm.xml to define that VM in new environment (you
 will see the VM might run without this but it is
 advisable to do above thing)
 My problem was a bit more difficult as the back I had was even buggy
 so the restoration did not      went very smooth.When  you are restoring
 the VMs then I noticed  some how permissions and        softlinks had
 broken.

        Once you have finished copying the virtual machines permissions of
 xml files in
        /etc/libvirt/qemu/
        should be changed to 644 any other file if you see has permission 777
 needs to be 644 but the
        same does not applies to directories.
Sorry here the permissions need to be 700 and  644 as I previously told.

-- 
ubuntu-server mailing list
ubuntu-server@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server
More info: https://wiki.ubuntu.com/ServerTeam


Re: recovery of virtual machines on KVM

2011-02-11 Thread Ahmed Kamal

On 02/09/2011 08:39 PM, Tapas Mishra wrote:

I  am having a virtualization setup via KVM on a Ubuntu 10.04 64 bit server.

A recent dbus update cause a crash of my Host OS.It was a post install
script of dbus which ultimately brought everything down.

Now I have to basically format the host OS.My cause of concern are the
virtual machines which were running on it when the environment was
stable.Which were in separate LVM partitions.

Some thing like

/dev/virtualization/vm1
/dev/virtualization/vm2
/dev/virtualization/vm3
/dev/virtualization/vm4
If some one has experienced recovery of this sort in past let me know
what did they do to get things back. All my Virtual Machines were on
separate partition and in same VolumeGroup this volume group was on
Host OS. Will formatting of HOST os clear the Virtual Machines also in
my situation or just be re installing the host and importing the
Virtual Machines via a tool such as virt-manager I will be able to get
them back.


It depends, if the VG is stored on the same disk and you reinstall you 
might indeed destroy the VMs. Please don't proceed until you're sure of 
what you're doing


--
ubuntu-server mailing list
ubuntu-server@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server
More info: https://wiki.ubuntu.com/ServerTeam


Re: recovery of virtual machines on KVM

2011-02-10 Thread Tapas Mishra
On Thu, Feb 10, 2011 at 1:40 PM, Alvin i...@alvin.be wrote:
 On Wednesday 09 February 2011 19:39:57 Tapas Mishra wrote:
 I  am having a virtualization setup via KVM on a Ubuntu 10.04 64 bit
 server.

 A recent dbus update cause a crash of my Host OS.It was a post install
 script of dbus which ultimately brought everything down.

 Now I have to basically format the host OS.My cause of concern are the
 virtual machines which were running on it when the environment was
 stable.Which were in separate LVM partitions.

 Some thing like

 /dev/virtualization/vm1
 /dev/virtualization/vm2
 /dev/virtualization/vm3
 /dev/virtualization/vm4
 If some one has experienced recovery of this sort in past let me know
 what did they do to get things back. All my Virtual Machines were on
 separate partition and in same VolumeGroup this volume group was on
 Host OS. Will formatting of HOST os clear the Virtual Machines also in
 my situation or just be re installing the host and importing the
 Virtual Machines via a tool such as virt-manager I will be able to get
 them back.

 Before your reinstall, dump the configuration of your virtual machines like
 this:
 $ virsh dumpxml vm1  vm1.xml
 After reinstall, redefine the machines
 $ virsh define vm1.xml

 It's that simple, but of course you have to leave your LVM volumes in place
 and make sure your host has the same network interfaces (as defined in the
 xml).

Not possible because the host OS where I was getting this problem I
was not even able to login.
So what I did is a fresh install and copied the xml files from a
backup I had on a USB is that not the correct way to do?
I just noticed I am unable to connect to guest OS after this i.e. when
the host OS reboots and then I immedialtely do an SSH to the guest
from any machine within my network I am able to do so but after 5-10
minutes if I again do an ssh to the same guest then I get host not
found error.

-- 
ubuntu-server mailing list
ubuntu-server@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server
More info: https://wiki.ubuntu.com/ServerTeam


recovery of virtual machines on KVM

2011-02-09 Thread Tapas Mishra
I  am having a virtualization setup via KVM on a Ubuntu 10.04 64 bit server.

A recent dbus update cause a crash of my Host OS.It was a post install
script of dbus which ultimately brought everything down.

Now I have to basically format the host OS.My cause of concern are the
virtual machines which were running on it when the environment was
stable.Which were in separate LVM partitions.

Some thing like

/dev/virtualization/vm1
/dev/virtualization/vm2
/dev/virtualization/vm3
/dev/virtualization/vm4
If some one has experienced recovery of this sort in past let me know
what did they do to get things back. All my Virtual Machines were on
separate partition and in same VolumeGroup this volume group was on
Host OS. Will formatting of HOST os clear the Virtual Machines also in
my situation or just be re installing the host and importing the
Virtual Machines via a tool such as virt-manager I will be able to get
them back.

-- 
ubuntu-server mailing list
ubuntu-server@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server
More info: https://wiki.ubuntu.com/ServerTeam