The installation instructions are for OpenNebula 6.4+.
If you are upgrading addon-storpool please read first the Upgrade notes section below!
See the Requirements section in StorPool storage driver.
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-utilsAlso 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 tarcd ~
git clone https://github.com/OpenNebula/addon-storpoolThe 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.logThe following commands are related to latest Stable version of OpenNebula.
-
Copy the DATASTORE_MAD driver files.
cp -a ~/addon-storpool/datastore/storpool /var/lib/one/remotes/datastore/ # copy xpath_multi.py cp ~/addon-storpool/datastore/xpath_multi.py /var/lib/one/remotes/datastore/
-
Copy the TM_MAD driver files.
cp -a ~/addon-storpool/tm/storpool /var/lib/one/remotes/tm/ -
Copy the VM_MAD driver files.
cp -a ~/addon-storpool/vmm/kvm/snapshot_* /var/lib/one/remotes/vmm/kvm/
-
Prepare the fix for the volatile disks (needs to be enabled in /etc/one/oned.conf).
# copy the helper for deploy-tweaks cp -a ~/addon-storpool/vmm/kvm/deploy-tweaks* /var/lib/one/remotes/vmm/kvm/ mkdir -p /var/lib/one/remotes/vmm/kvm/deploy-tweaks.d cd /var/lib/one/remotes/vmm/kvm/deploy-tweaks.d cp ../deploy-tweaks.d.example/volatile2dev.py . # the local attach_disk script cp -a ~/addon-storpool/vmm/kvm/attach_disk.storpool /var/lib/one/remotes/vmm/kvm/ # the tmsave/tmrestore scripts cp -L ~/addon-storpool/vmm/kvm/tm* /var/lib/one/remotes/vmm/kvm/
-
Copy reserved.sh helper tool to /var/lib/one/remotes/.
cp -a ~/addon-storpool/misc/reserved.sh /var/lib/one/remotes/ -
Copy storpool_probe.sh tool to /var/lib/one/remotes/im/kvm-probes.d/host/system/.
cp -a ~/addon-storpool/misc/storpool_probe.sh /var/lib/one/remotes/im/kvm-probes.d/host/system/ -
Fix ownership of the files in /var/lib/one/remotes/.
chown -R oneadmin.oneadmin /var/lib/one/remotes/vmm/kvm
-
Create
tmpfilesconfiguration to create/var/cache/addon-storpool-monitor.cp -v addon-storpool/misc/etc/tmpfiles.d/addon-storpool-monitor.conf /etc/tmpfiles.d/ systemd-tmpfiles --create
-
Create a systemd timer for stats polling (alter the file paths if needed)
cp -v addon-storpool/misc/systemd/system/monitor_helper-sync* /etc/systemd/system/ systemctl daemon-reload systemctl enable --now monitor_helper-sync.timer
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.
-
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.
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-storpool -
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')