StratusLab / client

Command Line Interface (CLI) for StratusLab cloud services
Apache License 2.0
2 stars 1 forks source link

stratus-create-image does not clean up the created image #154

Closed rybkine closed 5 years ago

rybkine commented 9 years ago

StratusLab/image-recipes#20 (raised by @konstan and @loomis) indicates that the stratus-create-image command, in particular, does not handle the /etc/udev/rules.d/70-persistent-net.rules file containing information specific to the machine on which the (customized) image gets built. The StratusLab or any other (customized) image build procedure must ensure that the final image does not contain parts of the build machine specific configuration.

loomis commented 9 years ago

In my opinion, this is not a bug.

The StratusLab image creation mechanism is (largely) independent of the operating system running within the created image. The StratusLab procedure has no way of knowing what types of machine-dependent information or other sensitive information is in an image or where it is located. Moreover, modifying an image after a user's image creation script has run risks breaking the image by performing actions not desired by the user. I don't see anyway for StratusLab image creation mechanism to provide a general cleaning procedure that will work in all cases.

The only parts of the StratusLab image creation mechanism that depend on the underlying operating system is the package management. Here, either yum or apt-get are run as a convenience for the user. If the image doesn't support either command, then no package installation is done. These are done before the user's script runs, so it allows the user to know what changes were made and to correct them if needed.

rybkine commented 9 years ago

There may well be a more suitable word to call this. Nevertheless, the situation ought to be handled within the customized image build procedure (rather than worked around elsewhere). At the minimum, the /etc/udev/rules.d/70-persistent-net.rules file needs to be dealt with. My proposal in the udev issue should be quite straightforward to implement here. More generally, there are tools to do this sort of image post-processing. The tools also hanlde the various log files, caches, etc. I will be looking into what their application to the customized image build procedure implies.