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.
Edit
/etc/one/oned.confand addstorpoolto theTM_MADarguments:TM_MAD = [ executable = "one_tm", arguments = "-t 15 -d dummy,lvm,shared,fs_lvm,qcow2,ssh,vmfs,ceph,dev,storpool" ]
Edit
/etc/one/oned.confand addstorpoolto theDATASTORE_MADarguments:DATASTORE_MAD = [ executable = "one_datastore", arguments = "-t 15 -d dummy,fs,vmfs,lvm,ceph,dev,storpool -s shared,ssh,ceph,fs_lvm,qcow2,storpool" ]
When
storpoolbacked SYSTEM datastore is used, edit/etc/one/oned.confand update the ARGUMENTS of theVM_MADforKVMto 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", ...
Edit
/etc/one/oned.confand appendTM_MAD_CONFdefinition 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 = "" ]
Edit
/etc/one/oned.confand appendDS_MAD_CONFdefinition for StorPool:DS_MAD_CONF = [ NAME = "storpool", REQUIRED_ATTRS = "DISK_TYPE", PERSISTENT_ONLY = "NO", MARKETPLACE_ACTIONS = "export" ]
Edit
/etc/one/oned.confand 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_
Enable live disk snapshots support for StorPool by adding
kvm-storpoolto theLIVE_DISK_SNAPSHOTSvariable in/etc/one/vmm_exec/vmm_execrc:LIVE_DISK_SNAPSHOTS="kvm-qcow2 kvm-ceph kvm-storpool"
RAFT_LEADER_IPThe 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
If you plan to do live disk snapshots with fsfreeze via qemu-guest-agent but
SCRIPTS_REMOTE_DIRis not the default one (if it is changed in/etc/one/oned.conf), defineSCRIPTS_REMOTE_DIRin the drivers configuration.
Post-installation steps
Restart the
opennebulaservice:systemctl restart opennebula
As oneadmin user (re)sync the remote scripts to the hosts:
su - oneadmin -c 'onehost sync --force'
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:
Stop all opennebula services.
Upgrade the opennebula packages - but do not reconfigure anything yet.
Upgrade the addon (checkout/clone latest from github and run AUTOCONF=1 bash install.sh)
Follow the addon configuration steps in OpenNebula configuration to (re)configure the driver.
Continue (re)configuring OpenNebula following the upstream docs.
After upgrade:
Run
misc/tagVolumes.shto update/apply the common tags for volumes/snapshots.Remove old cron configuration files
/etc/cron.d/vc-policy,/etc/cron.d/addon-storpoolRun 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')