Forked from Jimmy-Z/pve-cloud-init-template-debian.sh
Created
March 22, 2024 08:22
-
-
Save cdseoo/05ba75a95903a0518637868daf9c8c35 to your computer and use it in GitHub Desktop.
Revisions
-
Jimmy-Z revised this gist
Mar 1, 2023 . 1 changed file with 11 additions and 21 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,31 +1,21 @@ #!/bin/sh # apt install curl # obviously change this per your needs VMID=9001 STOR=local-lvm VER=20230124-1270 URL_PATH=https://cloud.debian.org/images/cloud/bullseye/$VER/ IMG=debian-11-genericcloud-amd64-$VER.qcow2 curl -L -o $IMG -C - $URL_PATH$IMG # https://pve.proxmox.com/wiki/Cloud-Init_Support # https://pve.proxmox.com/wiki/Qemu/KVM_Virtual_Machines qm create $VMID --cores 4 --cpu cputype=host --memory 4096 --net0 virtio,bridge=vmbr0 --ostype l26 --serial0 socket --vga serial0 qm importdisk $VMID $IMG $STOR qm set $VMID --scsihw virtio-scsi-single --scsi0 $STOR:vm-$VMID-disk-0,discard=on,iothread=true qm set $VMID --ide2 $STOR:cloudinit qm set $VMID --boot c --bootdisk scsi0 qm template $VMID -
Jimmy-Z created this gist
Apr 23, 2020 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,31 @@ #!/bin/sh # apt install parted # obviously change this per your needs VMID=9000 DEB_OS_IMG=debian-10.3.2-20200406-openstack-amd64.qcow2 DISK=/dev/mapper/pve-vm--$VMID--disk--0 wget -c https://cloud.debian.org/images/cloud/OpenStack/current/$DEB_OS_IMG # https://pve.proxmox.com/wiki/Cloud-Init_Support # https://pve.proxmox.com/wiki/Qemu/KVM_Virtual_Machines qm create $VMID --cores 4 --cpu cputype=host --memory 4096 --net0 virtio,bridge=vmbr0 --ostype l26 --serial0 socket --vga serial0 qm importdisk $VMID $DEB_OS_IMG local-lvm qm set $VMID --scsihw virtio-scsi-single --scsi0 local-lvm:vm-$VMID-disk-0,discard=on,iothread=true qm set $VMID --ide2 local-lvm:cloudinit qm set $VMID --boot c --bootdisk scsi0 # https://pve.proxmox.com/wiki/Resize_disks qm resize $VMID scsi0 20G fdisk -l $DISK parted --script $DISK 'resizepart 1 100%' fdisk -l $DISK e2fsck -yf ${DISK}p1 resize2fs ${DISK}p1 # http://blog.roberthallam.org/2017/12/solved-logical-volume-is-used-by-another-device/ sync dmsetup remove ${DISK}p1 qm template $VMID