Last active
April 29, 2020 19:43
-
-
Save ismailbay/c87f4b608e007e169bec3c8002834a45 to your computer and use it in GitHub Desktop.
create ubuntu18.04 VMs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# https://blog.alexellis.io/kvm-kubernetes-primer/ | |
NAME=$1 | |
CPUS=$2 | |
RAM=$3 | |
if [ -z "$NAME" ] ; | |
then | |
echo Specify a virtual-machine name. | |
exit 1 | |
fi | |
if [ -z "$RAM" ] ; | |
then | |
RAM=4096 | |
fi | |
if [ -z "$CPUS" ] ; | |
then | |
CPUS=2 | |
fi | |
echo creating VM $NAME with $CPUS cpus and $RAM RAM | |
sudo virt-install \ | |
--name $NAME \ | |
--ram $RAM \ | |
--disk path=/var/lib/libvirt/images/$NAME.img,size=30 \ | |
--vcpus $CPUS \ | |
--os-type linux \ | |
--os-variant ubuntu18.04 \ | |
--network bridge:br0,model=virtio \ | |
--graphics none \ | |
--console pty,target_type=serial \ | |
--location 'http://at.archive.ubuntu.com/ubuntu/dists/bionic/main/installer-amd64/' \ | |
--extra-args 'console=ttyS0,115200n8 serial' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://www.ismailbay.at/2020/04/26/multinode-k8s-on-fedora/