Last active
September 28, 2019 17:19
-
-
Save wopfel/1d6574a44f72a572dae5e38acc031aff to your computer and use it in GitHub Desktop.
Create lxc container on a Proxmox VE host
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/bash | |
NEXTID=518 | |
LXCNAME=testct3 | |
LXCIP=192.168.2.178 | |
#TEMPLATE=archlinux-base_20190426-1_amd64.tar.gz | |
TEMPLATE=ubuntu-19.04-standard_19.04-1_amd64.tar.gz | |
OSTYPE=${TEMPLATE%%-*} | |
lvcreate -V8G -T vg_ssd_evo/vms3 -n vm-$NEXTID-disk-0 | |
mkfs.ext4 /dev/mapper/vg_ssd_evo-vm--$NEXTID--disk--0 | |
pct create $NEXTID local:vztmpl/$TEMPLATE --hostname $LXCNAME --ostype $OSTYPE --ssh-public-keys [email protected] --rootfs vms3:vm-$NEXTID-disk-0,size=8G --cores 1 --net0 name=eth0,bridge=vmbr0,gw=192.168.2.1,ip=$LXCIP/24 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment