Difference between revisions of "How to build Proxmox tmpfs image"

From openQRM
Line 1: Line 1:
 
Once you have a successfully running openQRM Server you can follow the steps below for a Proxmox VE Solution.
 
Once you have a successfully running openQRM Server you can follow the steps below for a Proxmox VE Solution.
  
These instructions will enable you to proof of concept the Proxmox VE Solution as a tmpfs deployment, however the clustering requires special initialisation. We have developed the ATU Plugin to orchestrate these steps for synchronized cluster initilisation on start and backup configuration on shutdown.
+
Or we have a pre-built Proxmox template available for download.
 +
 
 +
These instructions will help you to build a Proxmox VE Solution as a tmpfs deployment. The clustering requires special initialisation which is managed by the ATU Plugin to orchestrate these steps for synchronized cluster initialisation on start and backup configuration on shutdown.
  
 
# Download PVE Kernel - http://download.proxmox.com/debian/dists/buster/pve-no-subscription/binary-amd64/pve-kernel-5.4.114-1-pve_5.4.114-1_amd64.deb
 
# Download PVE Kernel - http://download.proxmox.com/debian/dists/buster/pve-no-subscription/binary-amd64/pve-kernel-5.4.114-1-pve_5.4.114-1_amd64.deb
 
# Install Kernel
 
# Install Kernel
 
# Add Kernel to openQRM
 
# Add Kernel to openQRM
## (Replace KERNEL_NAME, KERNEL_VER, OPENQRM_UI_USER, OPENQRM_UI_PASS, SERVER_NAME with the appropriate variables)  openqrm kernel add -n KERNEL_NAME -v KERNEL_VER -u OPENQRM_UI_USER -p OPENQRM_UI_PASS -l / -i initramfs  
+
## (Replace KERNEL_NAME, KERNEL_VER, OPENQRM_UI_USER, OPENQRM_UI_PASS, SERVER_NAME with the appropriate variables)  openqrm kernel add -n KERNEL_NAME -v KERNEL_VER -u OPENQRM_UI_USER -p OPENQRM_UI_PASS -l / -i initramfs
 
## openqrm kernel add -n pve-5.4.114-1 -v 5.4.114-1-pve -u OPENQRM_USER -p OPENQRM_PASS -l / -i initramfs   
 
## openqrm kernel add -n pve-5.4.114-1 -v 5.4.114-1-pve -u OPENQRM_USER -p OPENQRM_PASS -l / -i initramfs   
### ''If you are using a self signed cert you may need to load the https call back manually;''  https://SERVER_NAME/openqrm/base/server/kernel/kernel-action.php?kernel_command=new_kernel&kernel_name=KERNEL_NAME&kernel_version=KERNEL_VER
+
###''If you are using a self signed cert you may need to load the https call back manually;''  https://SERVER_NAME/openqrm/base/server/kernel/kernel-action.php?kernel_command=new_kernel&kernel_name=KERNEL_NAME&kernel_version=KERNEL_VER
 
# Create Image - To create an image for Proxmox which can be used as a tmpfs image, follow these steps;
 
# Create Image - To create an image for Proxmox which can be used as a tmpfs image, follow these steps;
 
## apt-get install debootstrap
 
## apt-get install debootstrap
Line 27: Line 29:
 
### mkdir -p /etc/systemd/system/getty@tty1.service.d/
 
### mkdir -p /etc/systemd/system/getty@tty1.service.d/
 
### edit file; /etc/systemd/system/getty@tty1.service.d/noclear.conf add contents; [Service]  TTYVTDisallocate=no
 
### edit file; /etc/systemd/system/getty@tty1.service.d/noclear.conf add contents; [Service]  TTYVTDisallocate=no
##'''Remember: /etc/hosts needs a valid hostname with your ip address allocated by the dhcp server'''
+
##'''Remember: /etc/hosts needs a valid hostname with your ip address'''
 
### This is managed with the ATU plugin
 
### This is managed with the ATU plugin
 
## exit chroot, type exit
 
## exit chroot, type exit
Line 60: Line 62:
 
# Add NFS Volume (this triggers tmpfs storage)
 
# Add NFS Volume (this triggers tmpfs storage)
 
## Under Plugins -> Storage -> NFS-Storage -> Volume Admin -> Edit -> proxmox_image "ADD IMAGE"
 
## Under Plugins -> Storage -> NFS-Storage -> Volume Admin -> Edit -> proxmox_image "ADD IMAGE"
# restart server/vm incase of duplicate services started from chroot image initialisation
+
# restart server/vm in case of duplicate services started from chroot image initialisation
 
# Now create a TmpFs-Storage: Plugins -> Storage -> Tmpfs-storage -> Volume Admin -> New Storage
 
# Now create a TmpFs-Storage: Plugins -> Storage -> Tmpfs-storage -> Volume Admin -> New Storage
 
## Name: openqrm-tmpfs
 
## Name: openqrm-tmpfs
 
## Deployment Type: tmpfs-storage
 
## Deployment Type: tmpfs-storage
 
# Now Create an Image: Components -> Image  -> Add new Image -> Tmpfs-root deployment -> click edit on the "openqrm-tmpfs" -> Click "ADD NEW VOLUME"  
 
# Now Create an Image: Components -> Image  -> Add new Image -> Tmpfs-root deployment -> click edit on the "openqrm-tmpfs" -> Click "ADD NEW VOLUME"  
## Name: pve5
+
## Name: pve6
 
## Size: 4 GB
 
## Size: 4 GB
## Description: proxmox ve 5
+
## Description: proxmox ve 6
 
# Now you will need to link a resource to a server. A resource is a blank system/server/chassis and a Server is a configuration applied to a resource/blank system. So you can either manually add a server or if a system has booted via dhcp/pxe then that system will be selectable and named "idle" for this next step.
 
# Now you will need to link a resource to a server. A resource is a blank system/server/chassis and a Server is a configuration applied to a resource/blank system. So you can either manually add a server or if a system has booted via dhcp/pxe then that system will be selectable and named "idle" for this next step.
 
## Click "ADD A NEW SERVER"
 
## Click "ADD A NEW SERVER"
## Select the resource or manually setup a server  
+
## Select the resource or manually setup a server
 
## then select n image for server, select the pve5 = tmpfs-deployment as previously setup (leave the tick on edit image details after selection.
 
## then select n image for server, select the pve5 = tmpfs-deployment as previously setup (leave the tick on edit image details after selection.
 
## then select "Install from NAS/NFS" select the "proxmox_image" as above then click submit
 
## then select "Install from NAS/NFS" select the "proxmox_image" as above then click submit

Revision as of 18:50, 20 June 2021

Once you have a successfully running openQRM Server you can follow the steps below for a Proxmox VE Solution.

Or we have a pre-built Proxmox template available for download.

These instructions will help you to build a Proxmox VE Solution as a tmpfs deployment. The clustering requires special initialisation which is managed by the ATU Plugin to orchestrate these steps for synchronized cluster initialisation on start and backup configuration on shutdown.

  1. Download PVE Kernel - http://download.proxmox.com/debian/dists/buster/pve-no-subscription/binary-amd64/pve-kernel-5.4.114-1-pve_5.4.114-1_amd64.deb
  2. Install Kernel
  3. Add Kernel to openQRM
    1. (Replace KERNEL_NAME, KERNEL_VER, OPENQRM_UI_USER, OPENQRM_UI_PASS, SERVER_NAME with the appropriate variables) openqrm kernel add -n KERNEL_NAME -v KERNEL_VER -u OPENQRM_UI_USER -p OPENQRM_UI_PASS -l / -i initramfs
    2. openqrm kernel add -n pve-5.4.114-1 -v 5.4.114-1-pve -u OPENQRM_USER -p OPENQRM_PASS -l / -i initramfs
      1. If you are using a self signed cert you may need to load the https call back manually; https://SERVER_NAME/openqrm/base/server/kernel/kernel-action.php?kernel_command=new_kernel&kernel_name=KERNEL_NAME&kernel_version=KERNEL_VER
  4. Create Image - To create an image for Proxmox which can be used as a tmpfs image, follow these steps;
    1. apt-get install debootstrap
    2. Create directory mkdir -p /exports/proxmox_image/dev/pts
    3. debootstrap --arch amd64 buster /exports/proxmox_image/ https://deb.debian.org/debian/
    4. mount --bind /dev/pts /exports/proxmox_image/dev/pts
    5. mount --bind /dev/ /exports/proxmox_image/dev/
    6. mount --bind /proc /exports/proxmox_image/proc
    7. mount --make-rprivate /exports/proxmox_image/
    8. mount --bind /var/run/dbus /exports/proxmox_image/var/run/dbus
    9. chroot /exports/proxmox_image
    10. apt-get install wget net-tools screen locales collectd
    11. dpkg-reconfigure locales
    12. Follow steps (Start at "Install Proxmox VE") @ https://pve.proxmox.com/wiki/Install_Proxmox_VE_on_Debian_Buster
      1. We do not need to install grub
    13. set root password; passwd
    14. implement noclear for getty/inittab;
      1. mkdir -p /etc/systemd/system/getty@tty1.service.d/
      2. edit file; /etc/systemd/system/getty@tty1.service.d/noclear.conf add contents; [Service] TTYVTDisallocate=no
    15. Remember: /etc/hosts needs a valid hostname with your ip address
      1. This is managed with the ATU plugin
    16. exit chroot, type exit
    17. umount binds;
      1. umount /exports/proxmox_image/dev
      2. umount /exports/proxmox_image/dev/pts
      3. umount /exports/proxmox_image/proc
    18. For reference only; since Proxmox/Debian uses systemd management of services needs to be done externally of the chroot. To find enabled services;
      1. systemctl list-unit-files --root /exports/proxmox_image/  | grep enabled
    19. These services are managed by the ATU plugin. Since the ATU plugins manages cluster initialisation these services need to be started in an orderly fashion by the plugin. So then remove services from startup, systemd is not friendly, so we need to point systemctl to the root directory as follows;
      1. /bin/systemctl disable pve-cluster.service corosync.service pve-guests.service --root /exports/proxmox_image/
      2. /bin/systemctl disable lvm2-lvmpolld.socket lvm2-monitor.service --root /exports/proxmox_image/
      3. /bin/systemctl disable lxc.service lxc-net.service lxcfs.service lxc-monitord.service --root /exports/proxmox_image/
      4. /bin/systemctl disable portmap.service rpcbind.service nfs-client.target --root /exports/proxmox_image/
      5. /bin/systemctl disable iscsid.service iscsi.service open-iscsi.service --root /exports/proxmox_image/
      6. /bin/systemctl disable pve-firewall.service pvesr.timer pve-daily-update.timer --root /exports/proxmox_image/
      7. /bin/systemctl disable pve-ha-crm.service pve-ha-lrm.service pve-lxc-syscalld.service --root /exports/proxmox_image/
      8. /bin/systemctl disable pvebanner.service pvedaemon.service pvenetcommit.service --root /exports/proxmox_image/
      9. /bin/systemctl disable pveproxy.service pvestatd.service --root /exports/proxmox_image/
      10. /bin/systemctl disable qmeventd.service spiceproxy.service ssh.service --root /exports/proxmox_image/
      11. /bin/systemctl disable rsyslog.service syslog.service --root /exports/proxmox_image/
      12. /bin/systemctl disable smartd.service dm-event.socket rbdmap.service --root /exports/proxmox_image/
      13. /bin/systemctl disable ceph.target ceph-fuse.target --root /exports/proxmox_image/
      14. /bin/systemctl disable zfs.target zfs-mount.service zfs-share.service  --root /exports/proxmox_image/
      15. /bin/systemctl disable zfs-import.target zfs-import-cache.service zfs-volumes.target zfs-volume-wait.service zfs-share.service --root /exports/proxmox_image/
    20. If using the ATU Plugin then disable services: pvedaemon, pve-proxy, pve-manager, pve-cluster, cman, corosync, ceph, pvestatd, qemu-server, rrdcached, spiceproxy,
  5. Activate NFS Storage (if not already done so)
    1. Under Plugins -> Storage -> NFS-Storage
    2. Add NFS Storage;
    3. name "openqrm-nfs"
    4. Deployment Type: "nfs-deployment"
  6. Add NFS Volume (this triggers tmpfs storage)
    1. Under Plugins -> Storage -> NFS-Storage -> Volume Admin -> Edit -> proxmox_image "ADD IMAGE"
  7. restart server/vm in case of duplicate services started from chroot image initialisation
  8. Now create a TmpFs-Storage: Plugins -> Storage -> Tmpfs-storage -> Volume Admin -> New Storage
    1. Name: openqrm-tmpfs
    2. Deployment Type: tmpfs-storage
  9. Now Create an Image: Components -> Image -> Add new Image -> Tmpfs-root deployment -> click edit on the "openqrm-tmpfs" -> Click "ADD NEW VOLUME"
    1. Name: pve6
    2. Size: 4 GB
    3. Description: proxmox ve 6
  10. Now you will need to link a resource to a server. A resource is a blank system/server/chassis and a Server is a configuration applied to a resource/blank system. So you can either manually add a server or if a system has booted via dhcp/pxe then that system will be selectable and named "idle" for this next step.
    1. Click "ADD A NEW SERVER"
    2. Select the resource or manually setup a server
    3. then select n image for server, select the pve5 = tmpfs-deployment as previously setup (leave the tick on edit image details after selection.
    4. then select "Install from NAS/NFS" select the "proxmox_image" as above then click submit
    5. then select the kernel 5.4.114-1-pve then click submit
    6. Done
  11. Tar Image
    1. mkdir -p /usr/share/openqrm/web/boot-service/tmpfs/
    2. cd /exports/proxmox_image
    3. tar --exclude=usr/src --exclude=var/lib/apt/lists --exclude=usr/lib/jvm --exclude=var/lib/apt/lists --exclude=usr/share/man --exclude=usr/share/doc --exclude=usr/share/icons --numeric-owner -czf /usr/share/openqrm/web/boot-service/tmpfs/proxmox_image.tgz .
  12. Create NFS Image link to TmpFS image


Notes/Customisations:

  1. set root password (otherwise not able to login)
  2. Postfix may vomit a warning on boot
  3. Create directories /exports/custom/{fstab|modules|network}


Optional:

The ATU Plugin is optimised for Proxmox Cluster Deployments and TMPFS Server Configuration Sync Initialise ATU plugin