Skip to content

Commit

Permalink
Merge pull request #152 from OpenNebula/v24.12.0-next
Browse files Browse the repository at this point in the history
V24.12.0 next
  • Loading branch information
atodorov-storpool authored Jan 16, 2025
2 parents c274270 + 62b4b11 commit 5ec6eb9
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 8 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,13 @@ systemctl daemon-reload
systemctl enable --now monitor_helper-sync.timer
```

* Create tmpfiles configuration to create /var/cache/addon-storpool-monitor

```bash
cp -v addon-storpool/misc/etc/tmpfiles.d/addon-storpool-monitor.conf /etc/tmpfiles.d/
systemd-tmpfiles --create
```

### addon-storpool configuration

The global configuration of addon-storpool is in `/var/lib/one/remotes/addon-storpoolrc` file.
Expand Down
2 changes: 1 addition & 1 deletion datastore/storpool/monitor
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ fi

DRIVER_PATH="${0%/*}"
SP_JSON_PATH="/tmp"
SP_FE_JSON_PATH="/tmp/monitor"
SP_FE_JSON_PATH="/var/cache/addon-storpool-monitor"
SP_TEMPLATE_STATUS_JSON="storpool_template_status.json"
SP_CMD_TEMPLATE_STATUS="cat _SP_JSON_PATH_/_SP_TEMPLATE_STATUS_JSON_"
SP_CMD_TEMPLATE_STATUS_IMAGE="cat _SP_FE_JSON_PATH_/_CLUSTER_ID_/_SP_TEMPLATE_STATUS_JSON_"
Expand Down
2 changes: 1 addition & 1 deletion datastore/storpool/monitor_helper-sync
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function splog() { logger -t "ds_sp_${0##*/}" "[$$] $*"; }
set -o pipefail

SP_JSON_PATH="/tmp"
SP_FE_JSON_PATH="/tmp/monitor"
SP_FE_JSON_PATH="/var/cache/addon-storpool-monitor"
ONE_HOME="${ONE_HOME:-/var/lib/one}"


Expand Down
2 changes: 1 addition & 1 deletion docs/advanced_configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ SP_JSON_PATH="/tmp/"
# Path to the json files on the front-end
# (must be writable by the oneadmin user)
SP_FE_JSON_PATH="/tmp/monitor"
SP_FE_JSON_PATH="/var/cache/addon-storpool-monitor"
# datastores stats JSON and the command that generate them
SP_TEMPLATE_STATUS_JSON="storpool_template_status.json"
Expand Down
2 changes: 1 addition & 1 deletion misc/etc/systemd/system/monitor_helper-sync.service
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[Unit]
Description=Create cached StorPool data JSONs in /tmp/monitor
Description=Create cached StorPool data JSONs in /var/cache/addon-storpool-monitor
Wants=monitor_helper-sync.timer

[Service]
Expand Down
2 changes: 2 additions & 0 deletions misc/etc/tmpfiles.d/addon-storpool-monitor.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#Type Path Mode UID GID Age Argument
d /var/cache/addon-storpool-monitor 0755 oneadmin oneadmin - -
4 changes: 4 additions & 0 deletions scripts/install-6.4.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ for cronfile in "/etc/cron.d/addon-storpool" "/etc/cron.d/vc-policy"; do
fi
done

echo "*** Create tmpfiles.d configuration to handle /var/cache/addon-storpoolrc-monitor folder"
cp -v "${CWD}/misc/etc/tmpfiles.d/addon-storpool-monitor.conf" /etc/tmpfiles.d/
systemd-tmpfiles --create

echo "*** Processing the systemd timers"
for sName in monitor_helper-sync vc-policy; do
for sType in service timer; do
Expand Down
4 changes: 2 additions & 2 deletions tm/storpool/monitor
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ fi

DRIVER_PATH="${0%/*}"
SP_JSON_PATH="/tmp"
SP_FE_JSON_PATH="/tmp/monitor"
SP_FE_JSON_PATH="/var/cache/addon-storpool-monitor"
SP_TEMPLATE_STATUS_JSON="storpool_template_status.json"
SP_CMD_TEMPLATE_STATUS="cat _SP_JSON_PATH_/_SP_TEMPLATE_STATUS_JSON_"
SP_CMD_TEMPLATE_STATUS_IMAGE="cat _SP_FE_JSON_PATH_/_CLUSTER_ID_/_SP_TEMPLATE_STATUS_JSON_"
Expand Down Expand Up @@ -174,7 +174,7 @@ if [ -d "$(readlink -f $BASE_PATH)" ]; then
SP_CMD_SNAPSHOT_SPACE="${SP_CMD_SNAPSHOT_SPACE//_SP_JSON_PATH_/$SP_JSON_PATH}"
SP_CMD_SNAPSHOT_SPACE="${SP_CMD_SNAPSHOT_SPACE//_SP_FE_JSON_PATH_/$SP_FE_JSON_PATH}"

ONE_VM_POOL_XML="${ONE_VM_POOL_XML:-/tmp/monitor/one.pool}"
ONE_VM_POOL_XML="${ONE_VM_POOL_XML:-/var/cache/addon-storpool-monitor/one.pool}"
if [ -f "$ONE_VM_POOL_XML" ]; then
onevm_ts="$(stat -c %Y "$ONE_VM_POOL_XML")"
if boolTrue "DEBUG_TM_MONITOR"; then
Expand Down
3 changes: 1 addition & 2 deletions vmm/kvm/deploy-tweaks.d.example/disk-serial.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ def indent(elem, level=0, ind=" "):
else:
if not level:
return
print(f"{elem=} {elem.text=}")
if not elem.text or not elem.text.strip():
elem.text = None
if not elem.tail or not elem.tail.strip():
Expand All @@ -55,7 +54,7 @@ def indent(elem, level=0, ind=" "):
vm_element = ET.parse(xmlVm)
vm = vm_element.getroot()

t_diskserial = os.getenv('T_DISKSERIAL', "None").upper()
t_diskserial = os.getenv('T_DISKSERIAL', "DISABLED").upper()
t_diskserial_e = vm.find('.//USER_TEMPLATE/T_DISKSERIAL')
if t_diskserial_e is not None:
t_diskserial = t_diskserial_e.text.upper()
Expand Down

0 comments on commit 5ec6eb9

Please sign in to comment.