DomU-gen
Gestandaardiseerd genereren van virtuele machines.
virt-install --connect qemu:///system -n test-kvm -r 256 --vcpu=1 \ --disk path=/dev/mapper/kvm150--data-data--lv--install \ -l http://mirror.webhuis.nl/debian/dists/squeeze/main/installer-amd64 \ os-type linux --os-variant debiansqueeze --accelerate \ --network=bridge:br0 --hvm --vnc --debug --extra-args "auto=true preseed/url=http://mirror.webhuis.nl/webhuis-preseed-noswap-squeeze.cfg netcfg/disable_dhcp=true netcfg/get_ipaddress=10.22.23.167 netcfg/get_netmask=255.255.255.224 netcfg/get_gateway=10.22.23.161 netcfg/get_nameservers=10.22.23.187 hostname=test-kvm.webhuis.nl"
lvextend --extents +100%FREE /dev/vg-root-install/root
post install
Host
<disk type='block' device='disk'> <driver name='qemu' type='raw'/> <source dev='/dev/mapper/kvm150--swap-test--kvm'/> <target dev='vdb' bus='virtio'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/> </disk> <disk type='block' device='disk'> <driver name='qemu' type='raw'/> <source dev='/dev/mapper/kvm150--data-support--svn--dvg'/> <target dev='vdc' bus='virtio'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/> </disk>
boot met init=/bin/bash mount -rw -o remount / mkdir /hotv mv home opt tmp var -> hotv ln -s /hotv/var /var allemaal
Guest
1 fdisk -l 2 top 3 fdisk -l 4 fdisk /dev/vda 5 ls -al /dev/mapper/ 6 df -h 7 top 8 df -h 9 swapoff 10 vi /etc/fstab 11 lvdisplay 12 swapoff /dev/vg-root-install/swap_1 13 lvremove /dev/vg-root-install/swap_1 14 lvdisplay 15 lvextend -l +100%FREE root 16 lvextend -l +100%FREE /dev/vg-root-install/root 17 pvscan 18 fdisk /dev/vdb 19 mkswap /dev/vdb1 20 vi /etc/fstab 21 mount -a 22 top 23 swapon 24 swapon /dev/vdb1 25 top 26 fdisk /dev/vdc 27 mkfs.ext3 /dev/vdc1 28 mkdir /hotv 29 cd /hotv 30 mkdir home opt tmp var 31 ls -al
98 vgcreate data /dev/vdc1 99 lvcreate -l +100%FREE -n htv data 100 lvdisplay 101 mount -t ext3 /dev/data/htv /mnt/ 102 mkfs.ext3 /dev/data/htv 103 mount -t ext3 /dev/data/htv /mnt/
Terug naar: Webhuis bouwstenen