[SOLVED] Creating a Template from an image and configuring Network

Dec 7, 2021
6
0
1
Hello,

I have a Proxmox VE Server at Hetzner that I need to use for KVM virtualization (I have a /26 subnet). I want to create templates that will be later on used to fully clone then VM provisioning with Cloud-init.

My first question: I am creating a VM from an Ubuntu Cloud Image. Upon boot, I get the error "No Bootable hard Drive". my VM config is as following:

Code:
agent: 1
boot: order=scsi0;ide2;net0
cores: 2
ide0: storage:9000/vm-9000-cloudinit.qcow2,media=cdrom
ide2: ISO:iso/ubuntu-22.04-minimal-cloudimg-amd64.img,media=cdrom,size=2252M
ipconfig0: ip=<One Subnet IP>/32,gw=<My host IP>
memory: 2048
meta: creation-qemu=7.1.0,ctime=1675784495
name: Template-Ubuntu-2204
net0: virtio=06:52:EC:55:84:2B,bridge=vmbr0,firewall=1
numa: 0
ostype: l26
scsi0: storage:9000/vm-9000-disk-0.qcow2,discard=on,size=16G,ssd=1
scsihw: virtio-scsi-pci


My second question: If I create a guest VM and set Cloud-Init with a static IP from the subnet, what should be the Gateway IP?
Until now, I set up the network on my host machine based on this Tutorial as following (I replaced part of my host IP with 111):

Code:
#Start of automatically configured Network by Hetzner's install script
auto lo
iface lo inet loopback

iface lo inet6 loopback

auto enp195s0
iface enp195s0 inet static
    address 111.111.111.87/26
    gateway 111.111.111.65/64
    pointopoint 111.111.111.65
    up route add -net 111.111.111.64 netmask 255.255.255.192 gw 111.111.111.65 dev enp195s0

iface enp195s0 inet6 static
    address <MY HOST IPv6>/64
    gateway <MY HOST IPv6 GATEWAY>

iface enx4661900a8c3f inet manual
#End of automatically configured Network by Hetzner's install script

auto vmbr0
iface vmbr0 inet static
    address 111.111.111.87
    netmask 255.255.255.255
    bridge_ports none
    bridge_stp off
    bridge_fd 0
    bridge_maxwait 0
    pre-up brctl addbr vmbr0
    up ip route add <First Subnet IP>/32 dev vmbr0
    up ip route add <Second Subnet IP>/32 dev vmbr0
    ...
    
iface vmbr0 inet6 static
    address <MY HOST IPv6>/64
    
auto vmbr1
iface vmbr1 inet static
    address 10.20.30.1
    netmask 255.255.255.0
    bridge_ports none
    bridge_stp off
    bridge_fd 0
    post-up iptables -t nat -A POSTROUTING -s '10.20.30.0/24' -o eth0 -j MASQUERADE
    post-down iptables -t nat -D POSTROUTING -s '10.20.30.0/24' -o eth0 -j MASQUERADE

Any help will be appreciated since I am quite confused between all the different configurations available. Also if anyone has a straightforward tutorial, it would be of a great help. Thank you
 
My first question: I am creating a VM from an Ubuntu Cloud Image. Upon boot, I get the error "No Bootable hard Drive". my VM config is as following:
Cloud images are not ISO files, they are images of a disk. To use one you need to import it. See "man qm" "import disk" section.
You can find a related example here : https://kb.blockbridge.com/technote/proxmox-cirros/

If I create a guest VM and set Cloud-Init with a static IP from the subnet, what should be the Gateway IP?
If you are using an IP from your Cloud Provider's public network, then the gateway is the one that your Provider gave you.


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
 
  • Like
Reactions: Momedo

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!