You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
61 lines
2.4 KiB
61 lines
2.4 KiB
#!/bin/bash
|
|
|
|
set -x
|
|
|
|
sudo kvm \
|
|
-serial telnet:localhost:2004,server,nowait \
|
|
-monitor telnet:127.0.0.1:2005,server,nowait \
|
|
-vga none \
|
|
-daemonize \
|
|
-runas vapache \
|
|
-display none \
|
|
-nic tap,model=virtio,mac=52:54:00:12:34:24 \
|
|
-machine pseries,accel=kvm,kvm-type=HV \
|
|
-smp 2 \
|
|
-m 4096 \
|
|
-name vapache \
|
|
-drive format=qcow2,cache=writeback,discard=on,file=/srv/kvm/vapache/boot.img \
|
|
-drive format=qcow2,cache=writeback,discard=on,file=/srv/kvm/vapache/swap.img \
|
|
-drive format=qcow2,cache=writeback,discard=on,file=/srv/kvm/vapache/root.img \
|
|
-drive format=qcow2,cache=writeback,discard=on,file=/srv/kvm/vapache/home.img \
|
|
-drive format=qcow2,cache=writeback,discard=on,file=/srv/kvm/vapache/varwww.img
|
|
|
|
exit
|
|
-net nic,model=virtio \
|
|
-net user,hostfwd=tcp:192.168.110.22:50019-:22,hostfwd=tcp:192.168.110.22:80-:80,hostfwd=tcp:192.168.110.22:443-:443 \
|
|
-nographic \
|
|
-daemonize \
|
|
-display none \
|
|
-daemonize \
|
|
-runas jebba \
|
|
-cdrom /srv/devel/distros/debian/debian-apache-mini.iso \
|
|
-boot d \
|
|
-cdrom /srv/devel/distros/debian/debian-apache-mini.iso \
|
|
|
|
# ?
|
|
-object iothread,id=iothread-virtioscsi0 \
|
|
-device virtio-scsi-pci,id=virtioscsi0,bus=pci.3,addr=0x1,iothread=iothread-virtioscsi0
|
|
-drive file=/dev/rbd/nvmepool/vm-192-disk-1,if=none,id=drive-scsi0,cache=writeback,discard=on,format=raw,aio=threads,detect-zeroes=unmap
|
|
-device scsi-hd,bus=virtioscsi0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0,id=scsi0,bootindex=100
|
|
|
|
|
|
# IMAGE
|
|
# qemu-img create -f qcow2 /srv/KVM/apache/boot.img 256M
|
|
# qemu-img create -f qcow2 /srv/KVM/apache/swap.img 128M
|
|
# qemu-img create -f qcow2 /srv/KVM/apache/root.img 2G
|
|
# qemu-img create -f qcow2 /srv/KVM/apache/home.img 1G
|
|
# qemu-img create -f qcow2 /srv/KVM/apache/varwww.img 1G
|
|
|
|
# Resize
|
|
# qemu-img resize foo.img +10G
|
|
# qemu-img resize /srv/KVM/apache/root.img +10G
|
|
# qemu-img resize /srv/KVM/apache/home.img +50G
|
|
|
|
# to use the kvm_pr.ko kernel module.
|
|
# qemu-system-ppc64 -M pseries,accel=kvm,kvm-type=PR
|
|
# to use kvm_hv.ko instead.
|
|
# qemu-system-ppc64 -M pseries,accel=kvm,kvm-type=HV
|
|
|
|
#qemu-system-ppc64le \
|
|
# -net user,hostfwd=tcp:192.168.110.22:80-:80,hostfwd=tcp:192.168.110.22:443-:443,hostfwd=tcp:192.168.110.22:28208-:22 \
|