I’ve made some progress, but there’s still a long way to go.
By default, oneswap downloads the virtual machine disks into the /tmp directory. And in my case, OneSwap is installed directly on the same machine as the front-end. So I added the /tmp directory to “SAFE_DIRS” in OpenNebula. Then I increased the “Debug level” to get more information.
Now the script manages to create the Template and the disks in the datastore, as you can see here:
The problem is that I’ve had a few errors during script execution and when I deploy the VM, it doesn’t find its boot disk.
Here are the execution process and some log extracts: /var/log/one/oneswap.log and /var/log/one/oned.log
Setting up the source: -i libvirtxml /tmp/berluti.pj/local.xml..
Opening the source.....................................................................
Inspecting the source.
Inspecting guest OS..............................................................
Checking for sufficient free disk space in the guest
Converting Ubuntu 22.04.5 LTS to run on KVM, this may take a long time
Gathering mountpoint stats and converting guest.........
could not determine a way to update the configuration of Grub2...........................................
The QEMU Guest Agent will be installed for this guest at first boot..............................................
This guest has virtio drivers installed....
Mapping filesystem data to avoid copying unused and blank areas
Inspecting filesystems, this can take several minutes.............................
Closing the overlay...
Assigning disks to buses
Checking if the guest needs BIOS or UEFI to boot
Setting up the destination: -o disk -os /tmp/berluti.pj/conversions/....
Copying disk 1/3, this may take a long time
Copying disk 2/3, this may take a long time
Copying disk 3/3, this may take a long time
Creating output metadata
Finishing off
3 disks on the local disk for this VM: ["/tmp/berluti.pj/conversions/berluti.pj-sda", "/tmp/berluti.pj/conversions/berluti.pj-sdb", "/tmp/berluti.pj/conversions/berluti.pj-sdc"]
Creating Images in OpenNebula
Inspecting disk...Allocating image 0 in OpenNebula
Waiting for image to be ready. Timeout: 120 seconds.
Inspecting disk...Allocating image 1 in OpenNebula
Waiting for image to be ready. Timeout: 120 seconds.
Inspecting disk...Done (17.27s)
Injecting one-context...Running: virt-customize -q -a /tmp/berluti.pj/conversions/berluti.pj-sdc --uninstall cloud-init --copy-in /usr/share/one/context/one-context_6.10.0-3.deb:/tmp --install /tmp/one-context_6.10.0-3.deb --delete /tmp/one-context_6.10.0-3.deb --run-command 'systemctl enable network.service || exit 0'
Failed (72.36s)
Context injection command appears to have failed. Attempting fallbackRunning: virt-customize -q -a /tmp/berluti.pj/conversions/berluti.pj-sdc --uninstall cloud-init --copy-in /usr/share/one/context/one-context_6.10.0-3.deb:/tmp --firstboot-install /tmp/one-context_6.10.0-3.deb --run-command 'systemctl enable network.service || exit 0'
Success (37.49s)
Context will install on first boot, you may need to boot it twice.Installing qemu-guest-agent...Running: virt-customize -a /tmp/berluti.pj/conversions/berluti.pj-sdc --install qemu-guest-agent
Failed (68.46s)
Allocating image 2 in OpenNebula
Waiting for image to be ready. Timeout: 120 seconds.
Created images: [{:id=>72, :os=>false}, {:id=>73, :os=>false}, {:id=>74, :os=>"linux"}]
Adding 2 NICs, assigning networks from 1
Skipping MAC address for NIC#0
Could not find OpenNebula network matching the provided name. Setting to assigned network: 1
Found network '3131-VM-TEST31' but no guest network information. Adding blank NIC.
Skipping MAC address for NIC#0
Could not find OpenNebula network matching the provided name. Setting to assigned network: 1
Found network '3131-VM-TEST31' but no guest network information. Adding blank NIC.
Allocating the VM template...Success
VM Template ID: 22
Deleting password files.
Delete not enabled, leaving disks in /tmp/berluti.pj/conversions
Delete not enabled, leaving /tmp/berluti.pj alone.
unexpected token at 'Test,Prod,hyper-01.pp,hyper-02.pp,hyper-01.pj,hyper-02.pj'
/var/log/one/oneswap.log
D, [2025-06-28T14:44:44.771407 #153325] DEBUG -- : Failed to determine unit we run in, ignoring: No data available
D, [2025-06-28T14:44:47.308492 #153325] DEBUG -- : augeas failed to parse /etc/apt/preferences.d/ubuntu-pro-esm-apps:
D, [2025-06-28T14:44:47.308506 #153325] DEBUG -- : error "Get did not match entire input" at line 5 char 0 in lens /usr/share/augeas/lenses/dist/aptpreferences.aug:62.10-.72:
D, [2025-06-28T14:44:47.308521 #153325] DEBUG -- : augeas failed to parse /etc/apt/preferences.d/ubuntu-pro-esm-infra:
D, [2025-06-28T14:44:47.308538 #153325] DEBUG -- : error "Get did not match entire input" at line 5 char 0 in lens /usr/share/augeas/lenses/dist/aptpreferences.aug:62.10-.72:
D, [2025-06-28T14:44:47.308551 #153325] DEBUG -- : augeas failed to parse /etc/apt/sources.list.d/opennebula.list:
D, [2025-06-28T14:44:47.308562 #153325] DEBUG -- : error "Iterated lens matched less than it should" at line 1 char 4 in lens /usr/share/augeas/lenses/dist/aptsources.aug:59.12-.42:
D, [2025-06-28T14:44:47.308574 #153325] DEBUG -- : augeas failed to parse /etc/fail2ban/jail.conf:
D, [2025-06-28T14:44:47.308586 #153325] DEBUG -- : error "Get did not match entire input" at line 216 char 0 in lens /usr/share/augeas/lenses/dist/inifile.aug:497.25-.43:
D, [2025-06-28T14:44:47.308601 #153325] DEBUG -- : augeas failed to parse /etc/mke2fs.conf:
D, [2025-06-28T14:44:47.308612 #153325] DEBUG -- : error "Get did not match entire input" at line 39 char 0 in lens /usr/share/augeas/lenses/dist/mke2fs.aug:187.10-.57:
D, [2025-06-28T14:44:47.308626 #153325] DEBUG -- : augeas failed to parse /etc/profile.d/gawk.sh:
D, [2025-06-28T14:44:47.308641 #153325] DEBUG -- : error "Syntax error" at line 7 char 1 in lens /usr/share/augeas/lenses/dist/shellvars.aug:251.12-.60:
D, [2025-06-28T14:44:47.308653 #153325] DEBUG -- : augeas failed to parse /etc/profile.d/vte-2.91.sh:
D, [2025-06-28T14:44:47.308664 #153325] DEBUG -- : error "Syntax error" at line 27 char 24 in lens /usr/share/augeas/lenses/dist/shellvars.aug:251.12-.60:
D, [2025-06-28T14:44:47.584394 #153325] DEBUG -- : commandrvf: mount --bind /sys/fs/selinux /sysroot/selinux
D, [2025-06-28T14:44:47.643203 #153325] DEBUG -- : mount: /sysroot/selinux: mount point does not exist.
D, [2025-06-28T14:44:47.643284 #153325] DEBUG -- : dmesg(1) may have more information after failed mount system call.
D, [2025-06-28T14:44:47.647447 #153325] DEBUG -- : commandrvf: stdout=n stderr=n flags=0x0
D, [2025-06-28T14:44:47.647538 #153325] DEBUG -- : commandrvf: mount --bind /sys /sysroot/sys
D, [2025-06-28T14:44:47.702942 #153325] DEBUG -- : commandrvf: stdout=n stderr=n flags=0x0
D, [2025-06-28T14:44:47.703049 #153325] DEBUG -- : commandrvf: mount --bind /sys/fs/selinux /sysroot/sys/fs/selinux
D, [2025-06-28T14:44:47.757347 #153325] DEBUG -- : mount: /sysroot/sys/fs/selinux: mount point does not exist.
D, [2025-06-28T14:44:47.757447 #153325] DEBUG -- : dmesg(1) may have more information after failed mount system call.
/var/log/one/oned.log
<NAME>berl...", 100, false
Sat Jun 28 14:53:39 2025 [Z0][ImM][DDD]: _stat: 3072
Sat Jun 28 14:53:39 2025 [Z0][ImM][I]: Copying /tmp/berluti.pj/conversions/berluti.pj-sda to repository for image 72
Sat Jun 28 14:53:39 2025 [Z0][ReM][D]: Req:2000 UID:0 one.image.allocate result SUCCESS, 72
Sat Jun 28 14:53:40 2025 [Z0][ImM][DDD]: _cp: /var/lib/one//datastores/100/e1c1abeb4a875e78bce118c1963ce38b qcow2
Sat Jun 28 14:53:40 2025 [Z0][ImM][I]: Image (72) copied and ready to use.
Sat Jun 28 14:53:40 2025 [Z0][ImM][D]: Monitoring datastore nfs_images (100)
Sat Jun 28 14:53:40 2025 [Z0][ReM][DD]: Number of active connections: 1
Sat Jun 28 14:53:40 2025 [Z0][ReM][D]: Req:9280 UID:0 IP:127.0.0.1 one.image.info invoked , 72, false
Sat Jun 28 14:53:40 2025 [Z0][ReM][D]: Req:9280 UID:0 one.image.info result SUCCESS, "<IMAGE><ID>72</ID><U..."
Sat Jun 28 14:53:40 2025 [Z0][ImM][DDD]: _monitor: VVNFRF9NQj0xNTk0MgpGUkVFX01CPTMxMjk3ODcKVE9UQUxfTUI9MzE0NTcyOAo=
Sat Jun 28 14:53:40 2025 [Z0][ImM][D]: Datastore nfs_images (100) successfully monitored.
Sat Jun 28 14:53:43 2025 [Z0][ReM][DD]: Number of active connections: 1
Sat Jun 28 14:53:43 2025 [Z0][ReM][D]: Req:992 UID:0 IP:127.0.0.1 one.hostpool.info invoked , -2, -1, -1
Sat Jun 28 14:53:43 2025 [Z0][ReM][D]: Req:992 UID:0 one.hostpool.info result SUCCESS, "<HOST_POOL><HOST><ID..."
Sat Jun 28 14:53:43 2025 [Z0][ReM][DD]: Number of active connections: 1
Sat Jun 28 14:53:43 2025 [Z0][ReM][D]: Req:8848 UID:0 IP:127.0.0.1 one.datastorepool.info invoked , -2, -1, -1
Sat Jun 28 14:53:43 2025 [Z0][ReM][D]: Req:8848 UID:0 one.datastorepool.info result SUCCESS, "<DATASTORE_POOL><DAT..."
Sat Jun 28 14:53:43 2025 [Z0][ReM][DD]: Number of active connections: 1
Sat Jun 28 14:53:43 2025 [Z0][ReM][D]: Req:1616 UID:0 IP:127.0.0.1 one.vmpool.info invoked , -2, -1, -1, -1, ""
Sat Jun 28 14:53:43 2025 [Z0][ReM][D]: Req:1616 UID:0 one.vmpool.info result SUCCESS, "<VM_POOL><VM><ID>65<..."
Sat Jun 28 14:53:47 2025 [Z0][ReM][DD]: Number of active connections: 1
Sat Jun 28 14:53:47 2025 [Z0][ReM][D]: Req:9056 UID:0 IP:127.0.0.1 one.zone.raftstatus invoked
Sat Jun 28 14:53:47 2025 [Z0][ReM][D]: Req:9056 UID:0 one.zone.raftstatus result SUCCESS, "<RAFT><SERVER_ID>-1<..."
Sat Jun 28 14:53:47 2025 [Z0][ReM][DD]: Number of active connections: 1
Sat Jun 28 14:53:47 2025 [Z0][ReM][D]: Req:6272 UID:0 IP:127.0.0.1 one.vmpool.infoextended invoked , -2, -1, -1, -1
Sat Jun 28 14:53:47 2025 [Z0][ReM][D]: Req:6272 UID:0 one.vmpool.infoextended result SUCCESS, "<VM_POOL><VM><ID>65<..."
Sat Jun 28 14:53:49 2025 [Z0][DBM][I]: Purging obsolete LogDB records: 0 records purged. Log state: 0,0 - 0,0
Sat Jun 28 14:53:49 2025 [Z0][DBM][I]: Purging obsolete federated LogDB records: 0 records purged. Federated log size: 0.
Sat Jun 28 14:53:51 2025 [Z0][ReM][DD]: Number of active connections: 1
Sat Jun 28 14:53:51 2025 [Z0][ReM][D]: Req:3776 UID:0 IP:127.0.0.1 one.image.allocate invoked , "<IMAGE>
<NAME>berl...", 100, false
Sat Jun 28 14:53:52 2025 [Z0][ImM][DDD]: _stat: 4096
Sat Jun 28 14:53:52 2025 [Z0][ImM][I]: Copying /tmp/berluti.pj/conversions/berluti.pj-sdb to repository for image 73
Sat Jun 28 14:53:52 2025 [Z0][ReM][D]: Req:3776 UID:0 one.image.allocate result SUCCESS, 73
Sat Jun 28 14:53:52 2025 [Z0][ImM][DDD]: _cp: /var/lib/one//datastores/100/7edf3d9a27a4bc992015c73e980409e1 qcow2
Sat Jun 28 14:53:52 2025 [Z0][ImM][I]: Image (73) copied and ready to use.
Sat Jun 28 14:53:52 2025 [Z0][ReM][DD]: Number of active connections: 1
Sat Jun 28 14:53:52 2025 [Z0][ImM][D]: Monitoring datastore nfs_images (100)
Sat Jun 28 14:53:52 2025 [Z0][ReM][D]: Req:624 UID:0 IP:127.0.0.1 one.image.info invoked , 73, false
Sat Jun 28 14:53:52 2025 [Z0][ReM][D]: Req:624 UID:0 one.image.info result SUCCESS, "<IMAGE><ID>73</ID><U..."
Sat Jun 28 14:53:52 2025 [Z0][ImM][DDD]: _monitor: VVNFRF9NQj0xNTk0MgpGUkVFX01CPTMxMjk3ODcKVE9UQUxfTUI9MzE0NTcyOAo=
Sat Jun 28 14:53:52 2025 [Z0][ImM][D]: Datastore nfs_images (100) successfully monitored.
Sat Jun 28 14:53:53 2025 [Z0][InM][D]: VM_STATE update from host: 2. VM id: 50, state: RUNNING
Sat Jun 28 14:53:53 2025 [Z0][InM][D]: VM_STATE update from host: 2. VM id: 56, state: RUNNING
Sat Jun 28 14:53:53 2025 [Z0][InM][D]: VM_STATE update from host: 2. VM id: 49, state: RUNNING
Need to get 251 kB of archives.
After this operation, 863 kB of additional disk space will be used.
Ign:1 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 qemu-guest-agent amd64 1:6.2+dfsg-2ubuntu6.26
Ign:1 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 qemu-guest-agent amd64 1:6.2+dfsg-2ubuntu6.26
Ign:1 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 qemu-guest-agent amd64 1:6.2+dfsg-2ubuntu6.26
Err:1 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 qemu-guest-agent amd64 1:6.2+dfsg-2ubuntu6.26
Could not resolve 'archive.ubuntu.com'
E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/universe/q/qemu/qemu-guest-agent_6.2%2bdfsg-2ubuntu6.26_amd64.deb Could not resolve 'archive.ubuntu.com'
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
virt-customize: error:
export DEBIAN_FRONTEND=noninteractive
apt_opts='-q -y -o Dpkg::Options::=--force-confnew'
apt-get $apt_opts update
apt-get $apt_opts install 'qemu-guest-agent'
: command exited with an error
If reporting bugs, run virt-customize with debugging enabled and include the complete output:
Sat Jun 28 14:57:07 2025 [Z0][ImM][DDD]: _stat: 204800
Sat Jun 28 14:57:07 2025 [Z0][ImM][I]: Copying /tmp/berluti.pj/conversions/berluti.pj-sdc to repository for image 74
Sat Jun 28 14:57:07 2025 [Z0][ReM][D]: Req:1488 UID:0 one.image.allocate result SUCCESS, 74
Sat Jun 28 14:57:08 2025 [Z0][ImM][DDD]: _monitor: VVNFRF9NQj0xNTk0MiBGUkVFX01CPTMxMjk3ODcgVE9UQUxfTUI9MzE0NTcyOAo=
Sat Jun 28 14:57:08 2025 [Z0][ImM][D]: Datastore nfs_system (101) successfully monitored.
Sat Jun 28 14:57:09 2025 [Z0][ReM][DD]: Number of active connections: 1
Sat Jun 28 14:57:09 2025 [Z0][ReM][D]: Req:5312 UID:0 IP:127.0.0.1 one.image.info invoked , 74, false
Thanks again @dclavijo for your help.