ProxmoxΒΆ

PurposeΒΆ

We use Proxmox VE for the virtualization of all of our Linux servers.

HostsΒΆ

The Proxmox node in the office is called proxmox1 and is reachable via SSH to proxmox1 and the proxmox1 WebUI. Please have a look at the Office proxmox topic for more informations about the setup in the office.

The Proxmox node in the datacenter is called proxmox2 and is reachable via SSH to proxmox2 and the proxmox2 WebUI. Please have a look at the Datacenter infrastructure topic for more informations about the setup in the datacenter.

Fresh installΒΆ

SetupΒΆ

To install a new Proxmox server, the most straight-forward way in the past was:

  • Install Debian via Expert Install

  • Use the mountoptions discard and relatime

  • Install the targeted initrd, which is smaller and only includes the modules needed

  • Install the openssh-server

  • Ensure SSH connectivity as root works (i.e. PermitRootLogin yes in /etc/ssh/sshd_config)

  • Install the Master Boot Record on both disks (i.e. sda and sdb)

  • Force grub-efi installation to the removable media path

Run AnsibleΒΆ

Then update the Ansible host vars so you can install the new Proxmox server without any dependencies, such as:

# DNS can't lookup the new/correct IP address yet, so let us work with the IP address.
network_public_ip: <new IP address>
ansible_host: <new IP address>

# The default DNS servers are on a private IP address, so use public DNS server until Proxmox reaches private DNS server.
resolv_nameservers:
  - 1.1.1.1

When the correct host vars are in place, Ansible can be run like this:

ansible -m ping -u root -k <proxmox hostname>
ansible-playbook playbooks/config_all.yml -l '<proxmox hostname>' -u root -k --ask-v

Hint

This should make the first plays (up to the user configuration & ssh changes) running smoothly. After that, Ansible will fail, because authentication fails mid-term (SSH config changes). Just run the playbook again, but remove the -u root -k flags, as your user & authorised SSH key should now be in place.

NetworkingΒΆ

Unlike all other Linux servers in our environment, the network interfaces of Proxmox are not configured via Ansible. You’ve to configure them manually in the Proxmox Web UI.

Users & groupsΒΆ

Make sure you create the required users & groups in the Proxmox Web UI. The configuration can be found here:

  • Group (i.e. Datacenter > Permissions > Groups)

  • Permission (i.e. Datacenter > Permissions)

  • User (i.e. Datacenter > Permissions > Users)

Hint

The LDAP realm is configured via Ansible. Just make sure you add your desired users with the correct permissions to Proxmox.

Hardware clockΒΆ

After ntp is installed, make sure the date / time is correct. Then update the hardware clock:

hwclock --systohc

Resize VM diskΒΆ

See also Proxmox Wiki.

  • Resize Disk via Proxmox GUI

  • Resize the PV via pvresize /dev/vdb

Hint

In case of resizing the rootvg Disk, you have to delete and recreate the partition via fdisk /dev/vda. Don’t wipe the LVM signature! Reboot the VM and resize the PV.

A safe and easy way to resize the rootvg is via the growpart utility. The utility takes up all the space it can.

# install growpart
apt -y install cloud-guest-utils

# extend partition 2 on /dev/vda
growpart /dev/vda 2

# resize PV
pvresize /dev/vda2