Editing
KVM
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
= Installatie fysieke host = Installeer een kale machine met ruimte voor: * 8 Gb voor de fysieke machine, primary partition * 2 Gb swap, eerste logical partition op de extended partition * LVM op de tweede logical partition van de extended partition Voor testuitvoer van het KVM gedeelte zie de uitvoer van tests na configuratiestappen in [[kvm_test | kvm test]]. == Prepareer LVM == Creeer het physical volume. <pre> root@host:~# pvcreate /dev/md0 root@host:~# pvcreate /dev/md1 root@host:~# vgcreate kvm-root /dev/md0 root@host:~# vgcreate kvm-data /dev/md1 </pre> root@host:~# pvcreate /dev/sda7 /dev/sdb7 Physical volume "/dev/sda6" successfully created en maak vervolens de volume group aan. root@sauron:~# vgcreate dev-kvm /dev/sda6 ==== Bijplaatsen extra disk ==== Kijk een beetje uit net het geven van namen aan volume groups. Er ontstaat een duplicate vg name conflict als je twee schijven samenvoegt als ze allebei dezelfde naam voor het physical volume hebben. <pre> root@host:~# pvscan PV /dev/sdb6 VG dev-xen lvm2 [223.52 GiB / 31.52 GiB free] PV /dev/sda7 VG dev-xen lvm2 [216.89 GiB / 16.89 GiB free] Total: 2 [440.41 GiB] / in use: 2 [440.41 GiB] / in no VG: 0 [0 ] /dev/sda7 2081 30394 227432173+ 8e Linux LVM /dev/sdb6 1216 30395 234374144 8e Linux LVM Los dit op met: vgimportclone -i /dev/sdb6 </pre> ==== Bijplaatsen netwerk interface ==== Het toekennen van een extra netwerk interface gaat als volgt: <pre> root@host:~# virsh attach-interface test-host --type bridge --source br1 root@host:~# virsh dumpxml test-host > /etc/libvirt/qemu/test-host.xml </pre> NB. De host zelf moet natuurlijk wel over een tweede interface en een bridge beschiken. === LVM snapshot logical volume === KVM maakt disk image aan op de LVM en daarbinnen partities. Om een partitie te mounten is een tussenstap nodig: <pre> # kpartx -av /dev/dev-kvm/samba add map dev--kvm-samba1 (253:17): 0 32112640 linear /dev/dev-kvm/samba 2048 add map dev--kvm-samba2 (253:18): 0 1435650 linear /dev/dev-kvm/samba 32116734 add map dev--kvm-samba5 : 0 1435648 linear 253:18 2 # mount -t ext3 /dev/mapper/dev--kvm-samba1 /mnt/dev-kvm/samba1/ </pre> Zie ook: * http://www.jmcneil.net/2010/05/kvm-virtual-disk-access/ === LVM verwijderen van mapper === Eerst kijken met: <pre> # dmsetup info dan: # dmsetup remove /dev/mapper/<naam> </pre> == Debian == De installatie verloopt vanaf een USB-stick met een netinstall, installeer een kale machine van 4 Gb met een swap space van 2 Gb. De uitvoer van tests na configuratiestappen staat in [[Kvm_test#Bridge_van_de_netwerkinterface | kvm test ]]. Voorbereiding virtuele machines:<br/> Vervolgens als de machine draait: udell-kvm:~# apt-get install kvm qemu lvm2 libvirt-bin virtinst bridge-utils virt-manager virt-clone virt-goodies virt-top * http://wiki.debian.org/KVM * http://www.howtoforge.com/virtualization-with-kvm-on-a-debian-lenny-server-p3 * http://www.punknix.com/virtualization_kvm * http://packages.debian.org/nl/lenny/kvm * http://www.linux-kvm.org/page/Management_Tools == Ubuntu Server == De installatie verloopt via een .iso image van een CDRom, dus na de install is de volgende stap nodig voor zowel de host als de guests: root@sauron:~# apt-get update && apt-get upgrade === De networkbridge voor KVM === <pre> martin@kvm-host:~$ cat /etc/network/interfaces # This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). # The loopback network interface auto lo br0 br1 allow-hotplug eth0 allow-hotplug eth1 iface lo inet loopback # The primary network interface iface br0 inet static address 10.22.23.148 netmask 255.255.255.240 network 10.22.23.144 gateway 10.22.23.145 bridge_ports eth0 bridge_fd 9 bridge_hello 2 bridge_maxage 12 bridge_stp off post-up /usr/local/bin/post-up-br0.sh iface br1 inet static address 10.22.23.132 netmask 255.255.255.240 network 10.22.23.128 # gateway 10.22.23.129 bridge_ports eth1 bridge_fd 9 bridge_hello 2 bridge_maxage 12 bridge_stp off martin@kvm-host:~$ </pre> udell-kvm:~# /etc/init.d/networking restart Voeg toe aan /etc/modules <pre> kvm kvm-intel </pre> udell-kvm:~# modprobe kvm kvm-intel === Inspectie dom0 === Inspecteer de dom0 met: root@sauron:~# virt-top Zie [[kvm_test#virt-top | kvm test]].
Summary:
Please note that all contributions to Webhuis wiki are considered to be released under the GNU Free Documentation License 1.3 or later (see
Project:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Voorpagina
Cobol and PostgreSQL
PostgreSQL
CFEngine
Proxmox
Webhuis Kennisbank
Basale infra
Webhuis bouwstenen
Webhuis configuratie
Webhuis Infra
Webhuis Support
Webhuis Raspberry
Opzet Applicaties
Business Applicaties
Community portal
Current events
Recent changes
Random page
Help
sitesupport
Tools
What links here
Related changes
Special pages
Page information