Override disk labels and introduce 'OS_SCRIPT'
* The call to update the metadata is moved inside the 'RunOsScriptsVirtualized' but before 'TemporaryDisks' because this call updates the instance configuration in the metadata daemon, and we want this configuration to be available when the helper VM starts, but we don't want it to contain information about the temporary disks. * The other call to update the metadata is extracted from the 'else' branch to the top-level of the function because we want to update metadata independently of whether the instance has an OS. * Disk paths must be overridden when running the instance inside a safe virtualized environment because, from the host perserspective, a disk path that looks like /srv/ganeti/file-storage/<instance>/e0105543-0979-4896-95c1-d2c477fafa9b.file.disk0 should be presented to the instance as /dev/xvda (Xen) /dev/vda (KVM) Therefore, we must pass the correct '/dev/*' disk paths to the safe virtualized environment when creating the environment file. To achieve this, extend backend and RPC for export OS to allow disk paths to be overridden. * The environment variable 'OS_SCRIPT' is introduce to tell the init script that runs inside the virtualized environment which OS script to run. In this patch, the OS script to run is 'create_untrusted', but in the future it can be overridden for import, export, and rename. Signed-off-by:Jose A. Lopes <jabolopes@google.com> Reviewed-by:
Hrvoje Ribicic <riba@google.com>
Showing
Please register or sign in to comment