Override disk labels and introduce 'OS_SCRIPT'
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 <0fb9c4f8511df4ec2ae28af879e9d462f6218a2c@google.com>
Reviewed-by: Hrvoje Ribicic <be5828fca31f89218048bec4189e30a581aa65da@google.com>

mbakke/ganeti,andir/ganeti,dimara/ganeti,dimara/ganeti,yiannist/ganeti,mbakke/ganeti,ganeti-github-testing/ganeti-test-1,ganeti/ganeti,leshchevds/ganeti,apyrgio/ganeti,leshchevds/ganeti,andir/ganeti,leshchevds/ganeti,apyrgio/ganeti,bitemyapp/ganeti,grnet/snf-ganeti,yiannist/ganeti,onponomarev/ganeti,andir/ganeti,bitemyapp/ganeti,onponomarev/ganeti,ganeti/ganeti,ganeti-github-testing/ganeti-test-1,mbakke/ganeti,yiannist/ganeti,grnet/snf-ganeti,ganeti/ganeti