Re: FAI going to the cloud

2016-09-27 Diskussionsfäden Thomas Lange
Hi Derek,

thanks a lot for all your ideas. fai-diskimage was written as a
wrapper script for several reasons. First I tried to implement it as a
new action like 'fai install' but I had some problems with that. The
wrapper script approach worked much better during the
development. Second, fai-diskimage has some other options, and will get
more diks image specific options in the future. Currently I do not see
much disadvantages in the wrapper script approach.

> The second issue is flexibility.  The fai-diskimage script doesn't really 
do that much: it creates and mounts an image at the beginning, then possibly 
converts the resulting image to QCOW2 format afterwards.  If the fai command 
were tweaked to allow a size to be specified, then the image creation could be 
accomplished with a hook for the partition task (or perhaps a new diskimage 
task).
Which flexibility is missing in the wrapper? All you can do in FAI,
can also be done when calling fai-diskimage.

> Whether the format conversion is needed could be inferred from whether 
the image filename ends in ".qcow2".  The conversion to QCOW2 could be done 
using a hook for faiend.
Yes, I also was thinking about detecting the image format on the name
suffix. Maybe I will change this and remove the -C option. Do you
think .raw is the right extension or is .img better? Which other
formats should be supported?

-- 
regards Thomas


Re: FAI going to the cloud

2016-09-27 Diskussionsfäden Derek Poon
On Sep 22, 2016, at 5:48 PM, Thomas Lange  wrote:
> 
>> On Thu, 22 Sep 2016 17:31:54 -0700, Derek Poon  
>> said:
> 
>> Instead of fai-diskimage as a separate command, have you considered making 
>> it a mode of the fai command itself, analogous to `fai dirinstall`?  It 
>> would be nice to be able to write hooks for diskimage installs.
> fai-diskimage is a seperate script which calls "fai install"
> internally. You can write hooks for fai-diskinstall the same way as in
> fai itself, because it uses the same config space as fai.


I was actually trying to make two observations.

The first issue is user experience consistency.  We have:

   fai install
   fai sysinfo
   fai dirinstall /path/to/target/directory
   fai-diskimage -S 32G /path/to/image

The last one seems conceptually similar to dirinstall.  Why should it invoked 
differently, as "fai-diskimage" rather than "fai diskimage"?  Furthermore, the 
fai-diskimage command is hard-coded to do the "install" action, so these 
choices are mutually exclusive.

To me, "fai-diskimage" is closer in nature to "fai install" than to "fai-cd" or 
"fai-kvm", and should therefore behave similarly.


The second issue is flexibility.  The fai-diskimage script doesn't really do 
that much: it creates and mounts an image at the beginning, then possibly 
converts the resulting image to QCOW2 format afterwards.  If the fai command 
were tweaked to allow a size to be specified, then the image creation could be 
accomplished with a hook for the partition task (or perhaps a new diskimage 
task).

Whether the format conversion is needed could be inferred from whether the 
image filename ends in ".qcow2".  The conversion to QCOW2 could be done using a 
hook for faiend.

Personally, I would prefer the configuration approach over the wrapper script, 
since it allows for customization better.  (For example, it would be easy to 
add support for image formats other than QCOW2.)


On top of that, there would be one fewer man page to write.

I hope you will give these thoughts some consideration before making the next 
FAI release.

Derek