Linux/Proxmox: Difference between revisions

From Wiki
mNo edit summary
Line 1: Line 1:
== Install Ubuntu to be used for cloning with cloud-init ==
* not working:
<pre>
# in case of apt-cacher-ng
touch /etc/apt/apt.conf.d/00aptproxy
echo 'Acquire::http::Proxy "http://192.168.111.11:3142";' > /etc/apt/apt.conf.d/00aptproxy
</pre>
<pre>
apt update
apt install -y cloud-init cloud-initramfs-growroot qemu-guest-agent
</pre>
== Use Ubuntu Cloud-Init Image ==
== Use Ubuntu Cloud-Init Image ==
* upload cloud-init image from proxmox
* upload cloud-init image from proxmox
Line 33: Line 19:
qm set 9001 --cipassword "password"
qm set 9001 --cipassword "password"
qm set 9001 --ipconfig0 ip=dhcp
qm set 9001 --ipconfig0 ip=dhcp
</pre>
* manual rework
<pre>
touch /etc/apt/apt.conf.d/00aptproxy
echo 'Acquire::http::Proxy "http://192.168.111.11:3142";' > /etc/apt/apt.conf.d/00aptproxy
apt clean
</pre>


# clone vm
* clone VM
<pre>
qm clone 9001 123 --name docker1
qm clone 9001 123 --name docker1
qm resize 123 scsi0 20G
qm resize 123 scsi0 20G
</pre>




== Install Ubuntu to be used for cloning with cloud-init ==
* not working:
<pre>
# in case of apt-cacher-ng
touch /etc/apt/apt.conf.d/00aptproxy
echo 'Acquire::http::Proxy "http://192.168.111.11:3142";' > /etc/apt/apt.conf.d/00aptproxy
</pre>
<pre>
apt update
apt install -y cloud-init cloud-initramfs-growroot qemu-guest-agent
</pre>
</pre>



Revision as of 15:45, 9 December 2021

Use Ubuntu Cloud-Init Image

  • upload cloud-init image from proxmox
    • gui -> local storage -> iso images
iso folder:    /var/lib/vz/template/iso/

qm create 9001 --memory 2048 --net0 virtio,bridge=vmbr0

qm importdisk 9001 /var/lib/vz/template/iso/focal-server-cloudimg-amd64.img local-lvm
qm set 9001 --scsihw virtio-scsi-pci --scsi0 local-lvm:vm-9001-disk-0
qm set 9001 --ide0 local-lvm:cloudinit
qm set 9001 --boot c --bootdisk scsi0
qm set 9001 --serial0 socket --vga serial0
qm set 9001 --name "ubuntu-20.04-cloudinit"

# set cloud-init definitions
qm set 9001 --ciuser "username"
qm set 9001 --cipassword "password"
qm set 9001 --ipconfig0 ip=dhcp
  • manual rework
touch /etc/apt/apt.conf.d/00aptproxy
echo 'Acquire::http::Proxy "http://192.168.111.11:3142";' > /etc/apt/apt.conf.d/00aptproxy
apt clean
  • clone VM
qm clone 9001 123 --name docker1
qm resize 123 scsi0 20G



Install Ubuntu to be used for cloning with cloud-init

  • not working:
# in case of apt-cacher-ng
touch /etc/apt/apt.conf.d/00aptproxy
echo 'Acquire::http::Proxy "http://192.168.111.11:3142";' > /etc/apt/apt.conf.d/00aptproxy
apt update
apt install -y cloud-init cloud-initramfs-growroot qemu-guest-agent