Bug #3705

Images downloaded from the Marketplace to Ceph are left with DRIVER=qcow2

Added by Roy Keene over 6 years ago. Updated about 4 years ago.

Status:ClosedStart date:03/22/2015
Priority:NormalDue date:
Assignee:Vlastimil Holer% Done:

0%

Category:Drivers - Storage
Target version:Release 5.4
Resolution:fixed Pull request:
Affected Versions:OpenNebula 4.12

Description

Downloading an image from the Marketplace into a Ceph datastore correctly converts the image to raw format, but leaves the image with the tag "DRIVER" set to "qcow2"

A naive patch to ceph/cp looks like:

diff -uNr opennebula-4.10.2.orig/src/datastore_mad/remotes/ceph/cp opennebula-4.10.2-ceph/src/datastore_mad/remotes/ceph/cp
--- opennebula-4.10.2.orig/src/datastore_mad/remotes/ceph/cp    2015-01-14 12:11:50.000000000 -0500
+++ opennebula-4.10.2-ceph/src/datastore_mad/remotes/ceph/cp    2015-03-17 18:07:55.229239336 -0400
***OMITTED UNRELATED PATCHES***
 ssh_exec_and_log    "$DST_HOST" "$REGISTER_CMD" \
                     "Error registering $RBD_SOURCE in $DST_HOST" 

+# Ensure the image is specified as "raw" 
+(
+    tmpUpdateImageFile="${TMPDIR:-/tmp}/update-image-file-$$${RANDOM}${RANDOM}${RANDOM}.oi" 
+    echo 'DRIVER="raw"' > "${tmpUpdateImageFile}" 
+    oneimage update "${ID}" "${tmpUpdateImageFile}" --append
+    rm -f "${tmpUpdateImageFile}" 
+) 2>/dev/null >/dev/null </dev/null
+
 echo "$RBD_SOURCE" 

Associated revisions

Revision a2a1e830
Added by Vlastimil Holer about 4 years ago

B #3705: Override image DRIVER attribute by the datastore DRIVER

Revision 1393bff1
Added by Vlastimil Holer about 4 years ago

B #3705: Update DS_MAD fs/cp to support CONVERT/DRIVER

Revision 3c71258c
Added by Vlastimil Holer about 4 years ago

B #3705: DRIVER configuration for the TM_MAD_CONF

Revision 38e78223
Added by Vlastimil Holer about 4 years ago

B #3705: Default CONVERT=yes in fs/cp

Revision 3c9065fe
Added by Vlastimil Holer about 4 years ago

B #3705: Set DRIVER=qcow2 for TM_MAD qcow2

Revision ae96f4ea
Added by Vlastimil Holer about 4 years ago

B #3705: Don't override image DRIVER if CDROM

Revision 6383b752
Added by Vlastimil Holer about 4 years ago

B #3705: Add TEMPLATE/DRIVER=raw into exist. CEPH/LVM DS on migration

Revision 51bdcbdf
Added by Javi Fontan about 4 years ago

Merge pull request #309 from vholer/bug-3705

B #3705 Allow DRIVER override on datastore level

History

#1 Updated by Ruben S. Montero almost 6 years ago

  • Category set to Drivers - Storage

#2 Updated by Jaime Melis almost 6 years ago

  • Status changed from Pending to New

I like the idea of fixing this bug, but I would do this in the Core. For example, if the datastore has a "DRIVER" attribute, the core will overwrite the image's driver attribute with the datastore's. Setting to "New".

#3 Updated by Roy Keene over 4 years ago

Still present in OpenNebula 5.2.0

#4 Updated by Ruben S. Montero over 4 years ago

  • Target version set to Release 5.4

#5 Updated by Vlastimil Holer about 4 years ago

  • Assignee set to Vlastimil Holer

#6 Updated by Vlastimil Holer about 4 years ago

  • Assignee deleted (Vlastimil Holer)

Following PR should allow to set the DRIVER on datastore level to override the image DRIVER: https://github.com/OpenNebula/one/pull/309

#7 Updated by Vlastimil Holer about 4 years ago

  • Status changed from New to Closed
  • Assignee set to Vlastimil Holer
  • Resolution set to fixed

Merged by Javi.

Also available in: Atom PDF