Installation and upgrade

The installation instructions are for OpenNebula 6.4+.

If you are upgrading addon-storpool please read first the Upgrade notes section below!

Prerequisites

See the Requirements section in StorPool storage driver.

Pre-installation steps

Front-end dependencies

 CentOS 7 front-end
yum -y install --enablerepo=epel jq xmlstarlet nmap-ncat pigz tar xmllint python36-lxml
 AlmaLinux 8 front-end
dnf -y install --enablerepo=epel jq xmlstarlet nmap-ncat pigz tar libxml2 python3-lxml
 Ubuntu 22.04/24.04 front-end
apt -y install tar jq xmlstarlet netcat pigz python3-lxml libxml2-utils

Node dependencies

Also use when adding new hosts:

 CentOS 7 node-kvm
yum -y install --enablerepo=epel jq pigz python36-lxml xmlstarlet tar
 AlmaLinux 8 node-kvm
dnf -y install --enablerepo=epel jq pigz python3-lxml xmlstarlet tar
 Ubuntu 22.04/24.04 node-kvm
apt -y install jq xmlstarlet pigz python3-lxml libxml2-utils tar

Getting the addon from GitHub

cd ~
git clone https://github.com/OpenNebula/addon-storpool

Automated installation

The automated installation is best suitable for new deployments. The install script will try to do an upgrade if it detects that addon-storpool is already installed but it is possible to have errors due to non expected changes

If oned and sunstone services are on different servers it is possible to install only part of the integration:

  • Set environment variable AUTOCONF=1 to enable the automatic configuration of driver defaults in the opennebula configuration.

  • Run the install script as ‘root’ user and check for any reported errors or warnings:

cd addon-storpool
bash install.sh 2>&1 | tee install.log

Manual installation

The following commands are related to latest Stable version of OpenNebula.

addon-storpool configuration

The global configuration of addon-storpool is in /var/lib/one/remotes/addon-storpoolrc file.

  1. Edit /etc/one/oned.conf and add storpool to the TM_MAD arguments:

    TM_MAD = [
        executable = "one_tm",
        arguments = "-t 15 -d dummy,lvm,shared,fs_lvm,qcow2,ssh,vmfs,ceph,dev,storpool"
    ]
    
  2. Edit /etc/one/oned.conf and add storpool to the DATASTORE_MAD arguments:

    DATASTORE_MAD = [
        executable = "one_datastore",
        arguments  = "-t 15 -d dummy,fs,vmfs,lvm,ceph,dev,storpool  -s shared,ssh,ceph,fs_lvm,qcow2,storpool"
    ]
    
  3. When storpool backed SYSTEM datastore is used, edit /etc/one/oned.conf and update the ARGUMENTS of the VM_MAD for KVM to enable the deploy-tweaks script:

    VM_MAD = [
        NAME           = "kvm",
        SUNSTONE_NAME  = "KVM",
        EXECUTABLE     = "one_vmm_exec",
        ARGUMENTS      = "-l deploy=deploy-tweaks -t 15 -r 0 -p kvm",
        ...
    

    Optionally, add attach_disk, tmsave and tmrestore:

    VM_MAD = [
        NAME           = "kvm",
        SUNSTONE_NAME  = "KVM",
        EXECUTABLE     = "one_vmm_exec",
        ARGUMENTS      = "-l deploy=deploy-tweaks,attach_disk=attach_disk.storpool,save=tmsave,restore=tmrestore -t 15 -r 0 -p kvm",
        ...
    
  4. Edit /etc/one/oned.conf and append TM_MAD_CONF definition for StorPool:

    TM_MAD_CONF = [ NAME = "storpool", LN_TARGET = "NONE", CLONE_TARGET = "SELF", SHARED = "yes", DS_MIGRATE = "yes", DRIVER = "raw", ALLOW_ORPHANS = "yes", TM_MAD_SYSTEM = "" ]
    
  5. Edit /etc/one/oned.conf and append DS_MAD_CONF definition for StorPool:

    DS_MAD_CONF = [ NAME = "storpool", REQUIRED_ATTRS = "DISK_TYPE", PERSISTENT_ONLY = "NO", MARKETPLACE_ACTIONS = "export" ]
    
  6. Edit /etc/one/oned.conf and append the following VM_RESTRICTED_ATTR:

    cat >>/etc/one/oned.conf <<_EOF_
    VM_RESTRICTED_ATTR = "VMSNAPSHOT_LIMIT"
    VM_RESTRICTED_ATTR = "DISKSNAPSHOT_LIMIT"
    VM_RESTRICTED_ATTR = "VC_POLICY"
    VM_RESTRICTED_ATTR = "SP_QOSCLASS"
    _EOF_
    
  7. Enable live disk snapshots support for StorPool by adding kvm-storpool to the LIVE_DISK_SNAPSHOTS variable in /etc/one/vmm_exec/vmm_execrc:

    LIVE_DISK_SNAPSHOTS="kvm-qcow2 kvm-ceph kvm-storpool"
    
  8. RAFT_LEADER_IP

    The driver will try to autodetect the leader IP address from oned configuration; if it fails, set it manually in addon-storpoolrc:

    echo "RAFT_LEADER_IP=1.2.3.4" >> /var/lib/one/remotes/addon-storpoolrc
    
  9. If you plan to do live disk snapshots with fsfreeze via qemu-guest-agent but SCRIPTS_REMOTE_DIR is not the default one (if it is changed in /etc/one/oned.conf), define SCRIPTS_REMOTE_DIR in the drivers configuration.

Post-installation steps

  1. Restart the opennebula service:

    systemctl restart opennebula
    
  2. As oneadmin user (re)sync the remote scripts to the hosts:

    su - oneadmin -c 'onehost sync --force'
    
  3. Add oneadmin user to the mysyslog group if available:

    grep -q mysyslog /etc/group && usermod -a -G mysyslog oneadmin
    

Follow the addon configuration steps in OpenNebula configuration to configure the driver.

Upgrade

The suggested upgrade procedure is as follows:

  1. Stop all opennebula services.

  2. Upgrade the opennebula packages - but do not reconfigure anything yet.

  3. Upgrade the addon (checkout/clone latest from github and run AUTOCONF=1 bash install.sh)

  4. Follow the addon configuration steps in OpenNebula configuration to (re)configure the driver.

  5. Continue (re)configuring OpenNebula following the upstream docs.

After upgrade:

  1. Run misc/tagVolumes.sh to update/apply the common tags for volumes/snapshots.

  2. Remove old cron configuration files /etc/cron.d/vc-policy, /etc/cron.d/addon-storpool

  3. Run the following code to update the StorPool volume tags

    source /var/lib/one/remotes/addon-storpoolrc && while read -r -u 4 volume; do storpool volume "${volume}" update tag nloc=${ONE_PX:-one} tag virt=one; done 4< <(storpool -B -j volume list | jq -r --arg onepx "${ONE_PX:-one}" '.data[]|select(.name|startswith($onepx))|.name')