Differences between revisions 4 and 5
Revision 4 as of 2017-10-11 20:44:01
Size: 1908
Editor: scott
Comment:
Revision 5 as of 2017-10-12 21:43:17
Size: 1060
Editor: shran
Comment:
Deletions are marked like this. Additions are marked like this.
Line 25: Line 25:
Line 30: Line 29:


create a virtual machine


#!/bin/bash

NAME="stretch-template"
RAM="1024"
LVM_SIZE="4G"
LVM_GROUP="vg2"
OS="debian9"
MEDIA="/mnt/media/debian/stretch/debian-9.1.0-amd64-netinst.iso"

if [ $# -eq 0 ]
then
        echo "${0}: domain-name"
else
        NAME=${1}
fi
LVM_NAME="kvm_${NAME}_vda"

if [ ! -e /dev/${LVM_GROUP}/${LVM_NAME} ]
then

        # create lvm partition
        lvcreate --size ${LVM_SIZE} --name ${LVM_NAME} ${LVM_GROUP}

        # create the virtual machine
        virt-install --name ${NAME} --memory ${RAM} --disk /dev/${LVM_GROUP}/${VM_NAME},bus=virtio,format=raw --os-variant ${OS} --network bridge=br0,model=vitio --cdrom ${MEDIA} --graphics spice,listen=192.168.1.33,password=${NAME} --noutoconsole --virt-type kvm
else
        echo "${0}: refusing to overwrite existing domain";
fi

TODO

This is all that has no yet been done or documented

mailserver configure apt sources in template clone a virtual machine remove the spice/vnc option from the virsh xml firewall list disks monitoring diskspace disable saving .debs af download configure apt to remove .deb files after download /var/cache/apt/archives/ network planning hardware description vmx flag, i7, ram disks firewall keyscript should try thrice

Space used on vanilla Filesystem Size Used Avail Use% Mounted on /dev/mapper/vg1-root 1,9G 791M 954M 46% / /dev/md0 243M 53M 162M 25% /boot

mail we will configure this system with a mail server this server will later be configured to forward its mails to another mail account apt-get install postfix

on another system apt-get install xtightvncviewer vncviewer 192.168.1.33

apt-get install virt-viewer remote-viewer spice://kvm02:5900

setup debian on that system

kvm guest added packages net-tools vim apt sources, with src lines commented mlocate

None: TODO (last edited 2021-12-30 18:59:33 by Kristian Kallenberg)