[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [TEKNIK] KVM med base image



20. dec. 2010 19.30 skrev  <sslug@sslug>:
>
> Hej
>
> Jeg har brugt KVM til virtualisering og har længe brugt at klone
> eksisterende maskiner, når jeg skal bruge en ny.
> F.eks. har jeg en VM med en basal Ubuntu server installation. Den kloner
> jeg så med 'kvm-img -f qcow2 -b base.img web.img' og en kopi af XML'en fra
> den VM, jeg baserer den nye på. derefter installerer så hvad der kræves
> af en basal webserver.
>
> Det virker fint, men når jeg så går ud i tredje niveau, så går det
> galt på Ubuntu 10.10. Det gjorde det ikke på Ubuntu 10.4.
> Jeg kan oprette den nye VM, men ikke starte den, og af én eller anden
> grund skifter den ene VM's image ejer. Forvirret ?
>
> Jeg gør følgende:
>
> #Jeg har følgende til at starte med
> robert-crazy-laptop:~ $ kvm-img info
> /var/lib/libvirt/images/UbuntuServerBase.img
> image: /var/lib/libvirt/images/UbuntuServerBase.img
> file format: qcow2
> virtual size: 10G (10737418240 bytes)
> disk size: 1.1G
> cluster_size: 65536
> robert-crazy-laptop:~ $ kvm-img info
> /var/lib/libvirt/images/UbuntuWebServer.img
> image: /var/lib/libvirt/images/UbuntuWebServer.img
> file format: qcow2
> virtual size: 10G (10737418240 bytes)
> disk size: 209M
> cluster_size: 65536
> backing file: /var/lib/libvirt/images/UbuntuServerBase.img (actual path:
> /var/lib/libvirt/images/UbuntuServerBase.img)
>
> #Jeg laver så et nyt image som baseres på UbuntuWebServer.img
> robert-crazy-laptop:~ $ kvm-img create -f qcow2 -b
> /var/lib/libvirt/images/UbuntuWebServer.img
> /var/lib/libvirt/images/NewServer.img
> Formatting '/var/lib/libvirt/images/NewServer.img', fmt=qcow2
> size=10737418240 backing_file='/var/lib/libvirt/images/UbuntuWebServer.img'
> encryption=off cluster_size=0
> robert-crazy-laptop:~ $ ls -l /var/lib/libvirt/images
> -rw-r--r-- 1 root root     262144 2010-12-20 21:35 NewServer.img
> -r-------- 1 root root 1234894848 2010-10-03 15:34 UbuntuServerBase.img
> -r-------- 1 root root  218955776 2010-10-03 15:38 UbuntuWebServer.img
>
> #Derefter dumper jeg UbuntuWebServer VM'ens XML og fjerner uuid'et og
> robert-crazy-laptop:~ $ virsh dumpxml UbuntuWebServer | grep -v uuid | grep
> -v "mac address" | sed 's/UbuntuWebServer/NewServer/' > new.xml
> robert-crazy-laptop:~ $ virsh define new.xml
> Domain NewServer defined from new.xml
>
> #Intet er ændret i filerne
> robert-crazy-laptop:~ $ ls -l /var/lib/libvirt/images/
> -rw-r--r-- 1 root root     262144 2010-12-20 21:35 NewServer.img
> -r-------- 1 root root 1234894848 2010-10-03 15:34 UbuntuServerBase.img
> -r-------- 1 root root  218955776 2010-10-03 15:38 UbuntuWebServer.img
>
> #Men så prøver jeg at starte den nye VM
> robert-crazy-laptop:~ $ virsh start NewServer
> error: Failed to start domain NewServer
> error: operation failed: failed to retrieve chardev info in qemu with 'info
> chardev'
>
> #Og så har UbuntuWebServer.img skiftet ejer
> robert-crazy-laptop:~ $ ls -l /var/lib/libvirt/images
> -rw------- 1 root         root     262144 2010-12-20 21:19 NewServer.img
> -r-------- 1 root         root 1234894848 2010-10-03 15:34
> UbuntuServerBase.img
> -r-------- 1 libvirt-qemu kvm   218955776 2010-10-03 15:38
> UbuntuWebServer.img
> robert-crazy-laptop:~ $
>
>
> Nogen som ved, hvad der går galt ?
> Det virkede som sagt i Ubuntu 10.4.

Kører du med selinux slået til? Hvis ja, hvad får du hvis du kører:
ls -lZ /var/lib/libvirt/images

og bliver problemet løst ved?:
restorecon -R /var/lib/libvirt/images

Ellers kig i loggen for libvirt, der burde stå noget dér.

Mvh.
Kenni


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2011-01-01, 02:01 CET [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *