one
one copied to clipboard
onevm: disk-snapshot-create does not handle error if live snapshot feature is disabled
Description
If the live snapshot feature is disabled, onevm disk-snapshot-create still exits with zero exit code and reports that an snapshot was successfully created.
To Reproduce
- in /etc/one/vmm_exec/vmm_execrc set LIVE_DISK_SNAPSHOTS=""
- Restart services (not sure if required)
- Attempt to create an snapshot:
root@debian11-one:/home/vagrant# onevm disk-snapshot-create 1 0 TESTSNAPSHOT2 -v VM 1: disk snapshot created root@debian11-one:/home/vagrant# echo $? 0
- in the VM logfile it is to be seen, that snapshot creation failed:
Wed Aug 10 10:13:07 2022 [Z0][VM][I]: New state is ACTIVE
Wed Aug 10 10:13:07 2022 [Z0][VM][I]: New LCM state is DISK_SNAPSHOT
Wed Aug 10 10:13:07 2022 [Z0][VMM][E]: DISKSNAPSHOTCREATE: Cannot perform a live DISKSNAPSHOTCREATE operation
Expected behavior
onevm disk-snapshot-create should exit with error code != 0 and report cause for failure.
Details Version used: opennebula 6.2 on Debian Bullseye.
Progress Status
- [ ] Code committed
- [ ] Testing - QA
- [ ] Documentation (Release notes - resolved issues, compatibility, known issues)