Unknown driver format value 'save_as'

Hello,

I one of my long running and long existing VMs cannot be started anymore - it fails with a strange error message ($subject). I tried to delete it and attach its persistent disk to a different VM - I get the same error message in the VM error log.


Versions of the related components and OS (frontend, hypervisors, VMs):
OpenNebula 6.2 community edition

Steps to reproduce:
onevm attach 5443 --image 120

Current results:
No disk is attached (logs below).

Expected results:
Another disk should be visible from the VM.

** Log file snippet: **

Tue May 24 14:11:52 2022 [Z0][VM][I]: New LCM state is HOTPLUG
Tue May 24 14:11:54 2022 [Z0][VMM][I]: Successfully execute transfer manager driver operation: tm_attach.
Tue May 24 14:11:55 2022 [Z0][VMM][I]: Command execution fail (exit code: 1): cat << EOT | /var/lib/one/tmp/vmm/kvm/attach_disk '...ea' '/var/lib/one//datastores/0/5443/disk.2' 'sdb' '1' 'P...T4=' 5443 myhostname
Tue May 24 14:11:55 2022 [Z0][VMM][E]: attach_disk: Command "set -e -o pipefail
Tue May 24 14:11:55 2022 [Z0][VMM][I]: virsh --connect qemu:///system attach-device ...ea <(
Tue May 24 14:11:55 2022 [Z0][VMM][I]: cat <<EOT
Tue May 24 14:11:55 2022 [Z0][VMM][I]: <disk type='network' device='disk'><driver name='qemu' type='save_as' cache='none' discard='unmap'/><source name='one/one-120' protocol='rbd'><host name='ceph-mon1'/><host name='ceph-mon2'/><host name='ceph-mon3'/></source> <auth username='libvirt'> <secret type='ceph' uuid='...'/> </auth><target dev='sdb'/><address type='drive' controller='0' bus='0' target='1' unit='0'/></disk>
Tue May 24 14:11:55 2022 [Z0][VMM][I]: EOT
Tue May 24 14:11:55 2022 [Z0][VMM][I]: )" failed: error: Failed to attach device from /dev/fd/63
Tue May 24 14:11:55 2022 [Z0][VMM][I]: error: unsupported configuration: unknown driver format value 'save_as'
Tue May 24 14:11:55 2022 [Z0][VMM][I]: Could not attach one/one-120 (sdb) to ...ea
Tue May 24 14:11:55 2022 [Z0][VMM][I]: ExitCode: 1
Tue May 24 14:11:55 2022 [Z0][VMM][I]: Successfully execute transfer manager driver operation: tm_detach.
Tue May 24 14:11:55 2022 [Z0][VMM][I]: Failed to execute virtualization driver operation: attach_disk.

The image itself indeed has FORMAT=save_as attribute, which is not visible in Sunstone, only in the command line:

oneimage show 120
IMAGE 120 INFORMATION                                                           
ID             : 120                 
NAME           : Image Name
USER           : oneadmin            
GROUP          : somegroup                
LOCK           : None                
DATASTORE      : cephds              
TYPE           : OS                  
REGISTER TIME  : 05/09 16:26:13      
PERSISTENT     : Yes                 
SOURCE         : one/one-120         
PATH           : one/one-94          
FORMAT         : save_as             
SIZE           : 20G                 
STATE          : rdy                 
RUNNING_VMS    : 0                   

PERMISSIONS                                                                     
OWNER          : um-                 
GROUP          : um-                 
OTHER          : ---                 

IMAGE SNAPSHOTS                                                                 
AC  ID PARENT            DATE SIZE     NAME                                 
=>   0     -1  01/04 15:25:18 20G      2017-01-04-mysnapshot
IMAGE TEMPLATE                                                                  
DEV_PREFIX="sd"

VIRTUAL MACHINES

What should I do in order to be able to attach this disk to a vm? Thanks!

-Yenya

Apparently this is not something new - I have about 35 images with FORMAT=save_as, some of them very recent.

oneimage list | while read a; do oneimage show $a | grep -q save_as; done | wc -l

Bravely editing the MySQL database:

MariaDB [opennebula]> update image_pool set body=replace(body, "save_as", "raw") where oid=120;
Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0

and now I am able to attach the disk image 120 to a VM. Should I do the above UPDATE on all images containing <FORMAT>save_as</FORMAT> XML snippet in their imagepool.body?

If this is something set by older OpenNebula versions, maybe onedb fsck should be modified to fix this (as of now it does not catch this).

This issue has already been fixed in 6.2.1. You can fix the broken image templates with onedb update-body image --id XX.

Thanks! I am planning to update to 6.4 soon anyway.

-Yenya