Bug #1753

Images with $FSTYPE="save_as" are not created in $DS_MAD=fs datastore

Added by Laurent Grawet almost 8 years ago. Updated almost 8 years ago.

Status:ClosedStart date:02/01/2013
Priority:NormalDue date:
Assignee:Ruben S. Montero% Done:

0%

Category:Drivers - Auth
Target version:-
Resolution:worksforme Pull request:
Affected Versions:OpenNebula 3.8

Description

Hi,

Datablock images with $FSTYPE="save_as" are not created in $DS_MAD=fs datastore. However, the action completes successfully.
The reason is datastore/fs/mkfs script exits before running dd.

Here is a patch.

Cheers,

Laurent

fs-mkfs.patch Magnifier - Run dd before exit when $FSTYPE="save_as" (1017 Bytes) Laurent Grawet, 02/01/2013 07:39 PM


Related issues

Duplicated by Bug #1785: VMware with Shared Storage configuration cannot make vola... Closed 02/26/2013

Associated revisions

Revision 49ab858b
Added by Ruben S. Montero almost 8 years ago

bug #1753: Empty FSTYPES do not tries to make any filesystem

History

#1 Updated by Laurent Grawet almost 8 years ago

Looking at code, I could find a similar bug for vmfs, vmdk and lvm.
iscsi is ok.

#2 Updated by Ruben S. Montero almost 8 years ago

  • Status changed from New to Closed
  • Resolution set to worksforme

Hi,

This is the intended behavior, when an image is saved_as, the mkfs just makes a placeholder for the image, as the actual image will be copied when the VM is shutdown. iSCSI drivers is differnt as it actually needs to create a volume.

Note that in this case, the dd'ed image wont be used.

Thanks

Ruben

#3 Updated by Laurent Grawet almost 8 years ago

Hi,

I was trying to attach an unformatted datablock image to a windows vm. I used save_as as file system for that purpose in sunstone webif. It looks like it is not the right way to do it. Can you tell me how to create such unformatted image properly ?

Thanks,

Laurent

#4 Updated by Ruben S. Montero almost 8 years ago

Laurent Grawet wrote:

Hi,

I was trying to attach an unformatted datablock image to a windows vm. I used save_as as file system for that purpose in sunstone webif. It looks like it is not the right way to do it. Can you tell me how to create such unformatted image properly ?

There are several options depending on your final goal

  1. The unformatted datablock will be used as an scracth disk and you will not need to keep its contents. Use a volatile disk in the template definition, just add
    DISK = [ TYPE = fs,
    SIZE = 4096,
    FORMAT = raw ]
  1. You may want to keep the image. Then create an empty datablock as a regular image and then add it as any other disk. Use the following file for oneimage create

NAME = "windisk"
TYPE = DATABLOCK
SIZE = 4096
FSTYPE = vfat

then use it as

DISK = [ IMAGE = "windisk" ]

  1. You can always hotplug either a volatile disk or datablock if you forgot to add it to the initial VM.

Thanks,

Laurent

#5 Updated by Laurent Grawet almost 8 years ago

Hi Ruben,

"FORMAT = raw" is exactly what I need but for persistent image. Looking at code, I see datastore/fs/mkfs is calling mkfs_command in scripts_common.sh, which implements raw type, so I can use FSTYPE="raw" for persistent image.

Formating with file system makes no really sense in my case, because I will use this image with windows guest. So I will have to create partition table with at least one partition from inside the guest first, then format it with ntfs.

I couldn't find any mention of FSTYPE="raw" in documentation. It is worth document it in
http://opennebula.org/documentation:rel3.8:img_template
http://opennebula.org/documentation:rel3.8:img_guide

I first tried FSTYPE="" (leaving this field empty in sunstone) and, of course, image creation action failed because linux mkfs command with empty fstype arg failed. It has side effects with some ds drivers because you have to manually do the cleanup on storage afterwards. OpenNebula won't do it with image in error state.

It would be good to do this check in mkfs_command function.

Something like :

        "raw" | "" )
            echo "" 
            return 0
            ;;

Cheers,

Laurent

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

  • Assignee set to Ruben S. Montero

Hi

Done, added raw option here:
http://opennebula.org/documentation:rel3.8:img_template
and extra check is now mkfs_command function.

THANKS!

Ruben

#7 Updated by Laurent Grawet almost 8 years ago

Thanks, that's perfect !
(just a small typo in the doc: "Use raw to not to...")

Regards,

Laurent

Also available in: Atom PDF