Wednesday, October 3, 2018

How to create software raid1 mirroring in Proxmox PVE

These instructions below will show you how to create software raid1 (mirroring) in your proxmox pve. The example below uses 2 hard drives in /dev/sdb and /dev/sdc (yours may be different).

 

apt-get update 
apt-get upgrade
apt-get dist-upgrade

apt-get install mdadm

modprobe raid1
                        (do not need to add to /etc/modules)


cat /proc/mdstat


Prepare partitions to Linux Raid Auto-Detect:

fdisk -l
fdisk /dev/sdb
    type fd  (linux auto raid)




Copy partition from one drive to another

sfdisk -d /dev/sdb | sfdisk --force /dev/sdc



Remove previous RAID data if any:
mdadm --zero-superblock /dev/sdb1
mdadm --zero-superblock /dev/sdc1


Create the array with missing disk
mdadm --create /dev/md0 --level=1 --raid-disks=2 missing /dev/sdb1


Create the array with both disk
mdadm --create /dev/md0 --level=1 --raid-disks=2 /dev/sdb1 /dev/sdc1

-----------------------------------  (if using LVM stop here - continue to: https://sites.google.com/a/datafeedfile.com/code/proxmox/proxmoxrecreatelocalmd0lvm2basedsharedlocalfilesystem)

Create the filesystem
mkfs.ext4 /dev/md0

Double check to make sure all okay:
cat /proc/mdstat

Create mount target
mkdir /mnt/md0
chmod -R 777 /mnt/md0


Edit fstab
blkid

nano /etc/fstab
UUID=<UUID> /mnt/md0 ext4 defaults,noatime,nodiratime,noacl,data=writeback,barrier=0,nobh,errors=remount-ro 0 2

mount -a

reboot


Proxmox install boot options

linux ext4 hdsize=8
linux ext4 hdsize=10
linux ext4 hdsize=12
linux ext4 hdsize=16

For Proxmox 5.x I have been using linux ext4 hdsize=16 for 16GB in my PVE Root capacity. After Proxmox has been completely installed I usually have 1.4GB Free.

  • linux ext4 – sets the partition format to ext4. The default is ext3.
  • hdsize=nGB – this sets the total amount of hard disk to use for the Proxmox installation. This should be smaller than your disk size.
  • maxroot=nGB – sets the maximum size to use for the root partition. This is the max size so if the disk is too small, the partition may be smaller than this.
  • swapsize=nGB – sets the swap partition size in gigabytes.
  • maxvz-nGB – sets the maximum size in gigabytes that the data partition will be. Again, this is similar to maxroot and the final partition size may be smaller.
  • minfree=nGB – sets the amount of free space to remain on the disk after the Proxmox installation.

Tuesday, October 2, 2018

Restart all Proxmox services in PVE 5.x

Sometime you just need to restart promox pve services in your hardware nodes because they froze or not functioning properly. These commands below will help you restart all your proxmox services:

killall -9 corosync
systemctl restart pve-cluster
systemctl restart pvedaemon
systemctl restart pveproxy
systemctl restart pvestatd


Stopping ALL your proxmox services in Proxmox PVE 5.x

Sometime you just need to STOP promox pve services in your hardware nodes because they froze or not functioning properly. These commands below will help you stop all your proxmox services:

killall -9 corosync
systemctl stop pve-cluster
systemctl stop pvedaemon
systemctl stop pveproxy
systemctl stop pvestatd


Friday, September 7, 2018

CHOWN Permission Denied Errors during VZDUMP container backup from Proxmox GUI

When using Proxmox I have always backedup my containers into a shared NFS storage. Usually I would use Open Media Vault (OMV) to host the NFS service. It is a bit slow sometime, but it has worked well in version 4. When I tried to do the same in Proxmox 5.x I was surprise to find these errors during backup:
INFO: starting new backup job: vzdump 110 --storage omvbak1_sdb1tb --compress lzo --mode snapshot --node e4 --remove 0 INFO: Starting Backup of VM 110 (lxc) INFO: status = running INFO: CT Name: posidev INFO: mode failure - some volumes do not support snapshots INFO: trying 'suspend' mode instead INFO: backup mode: suspend INFO: ionice priority: 7 INFO: CT Name: posidev INFO: temporary directory is on NFS, disabling xattr and acl support, consider configuring a local tmpdir via /etc/vzdump.conf INFO: starting first sync /proc/27345/root// to /mnt/pve/omvbak1_sdb1tb/dump/vzdump-lxc-110-2018_09_07-08_22_21.tmp INFO: rsync: chown "/mnt/pve/omvbak1_sdb1tb/dump/vzdump-lxc-110-2018_09_07-08_22_21.tmp/." failed: Operation not permitted (1) INFO: rsync: chown "/mnt/pve/omvbak1_sdb1tb/dump/vzdump-lxc-110-2018_09_07-08_22_21.tmp/bin" failed: Operation not permitted (1) INFO: rsync: chown "/mnt/pve/omvbak1_sdb1tb/dump/vzdump-lxc-110-2018_09_07-08_22_21.tmp/bin/bzcmp" failed: Operation not permitted (1) INFO: rsync: chown "/mnt/pve/omvbak1_sdb1tb/dump/vzdump-lxc-110-2018_09_07-08_22_21.tmp/bin/bzegrep" failed: Operation not permitted (1) INFO: rsync: chown "/mnt/pve/omvbak1_sdb1tb/dump/vzdump-lxc-110-2018_09_07-08_22_21.tmp/bin/bzfgrep" failed: Operation not permitted (1) INFO: rsync: chown "/mnt/pve/omvbak1_sdb1tb/dump/vzdump-lxc-110-2018_09_07-08_22_21.tmp/bin/bzless" failed: Operation not permitted (1)

When I read the error message carefully, it complained about working inside temporary directory on NFS:

INFO: temporary directory is on NFS, disabling xattr and acl support, consider configuring a local

tmpdir via /etc/vzdump.conf so I did some research and found out that was indeed NOT GOOD! So I edited by /etc/vzdump.conf (must be edited manually in each hardware node)

from:




















 to:





SEE HOW THE FIRST LINE is different? Instead of DIR it is now pointing to my local RAID1 array mounted on /mnt/md0/tmp

That basically fixed my problem!  I can now backup by Proxmox containers to my NFS shared storage just like before. 

I hope this article helps someone to solve this issue.

If you like these articles about proxmox issues and solutions I have encountered please subscribe to my blog! 

Thanks

--Andrew

Tuesday, August 14, 2018

What you need to know about Proxmox VE 5.2

On May 16, 2018 the proxmox ve team in Vienna just released their newest Proxmox Virtual Environment (Proxmox VE) version 5.2.  Coincidentally a month after their 10th anniversary in April 2018.  Happy birthday proxmox ve!  I love this software!

Here are the most important points you need to know about Proxmox VE 5.2:

Cloud-Init

Proxmox VE 5.2 now includes cloud-init built in!  Cloud-init is a software package to help automating and setting up of virtual machines.

Cloud-init features includes:
  • Deploy VM based on templates
  • Pre configure host names, SSH keys, mount points
  • Run post install scripts
  • Enables automation tools such as Ansible, Puppet, Chef, and Salt
  • Access to pre-installed disk images and copy servers from pre-created server images
Best of all, all of the above features are now available in Proxmox VE 5.2' graphical user interface (web based GUI). Just awesome!  Thanks Proxmox Team!


SMB/CIFS Storage Plug-in

One of the strength of Proxmox VE is the fact that it comes pre-installed with many useful storage plug-ins such as Local directory, NFS, Ceph.  SMB/CIFS has been missing until now.  SMB obviously is very important and popular because it is the default file sharing protocol preferred by Windows / Microsoft.  It is also known to be faster and lighter on the data communication compared to NFS.  This addition of SMB/CIFS storage support to Proxmox VE 5.2 is definitely a huge improvement!


Let's Encrypt Certificate Management via GUI



Are you tired of seeing that warning message above?  Or having to spent the extra 5 seconds to make exception to allow yourself to see your own server? Yeah, me too!

Thanks to Proxmox VE 5.2, in the future setting up SSL on your Proxmox VE hardware nodes will be a breeze thanks to the built in GUI support to install Let's Encrypt SSL certificate.

In case you are not aware... Let's Encrypt SSL project allows anyone to get a FREE SSL certificate for any purpose (such as protecting your Proxmox VE server).

I have created a short video - How to get your own Free Let's Encrypt Certificate in less than 5 min:



Added features in Proxmox VE 5.2:

  • Creation of clusters via the graphical user interface. This feature makes creating and joining nodes to a Proxmox cluster extremely simple and intuitive even for novice users.
  • Expanded functionality of LXC: Creating templates or moving disks from one storage to another now also work for LXC. The move-disk function can be used for stopped/paused containers and instead of backup/restore.
  • If the QEMU guest agent is installed, the IP address of a virtual machine is displayed on the GUI
  • Administrators can now easily create and edit new roles via the GUI.
  • Setting I/O limits for restore operations is possible (globally or more fine-grained per storage) to avoid I/O load getting too high while restoring a backup.
  • Configuration of ebtables in the Proxmox VE Firewall.

I just want to once again say Thank You to the Proxmox VE team for making such a great software!