New Question
0

Azure Metadata Service fails on finding ovf-env.xml

asked 2021-03-31 01:03:36 +0300

rhockenbury gravatar image

I have a custom Windows image that I'm creating from a shared image gallery. I've created the image by first creating a vm from a 1909 Azure base image, installing cloudbase-init on the vm, sysprepping, then capturing the vm image in a share image gallery image version.

I'm getting on error with retrieving the ovf-env.xml file. On the VM, I can see that the E is available but there's no media:

  Volume ###  Ltr  Label        Fs     Type        Size     Status     Info
  ----------  ---  -----------  -----  ----------  -------  ---------  --------
  Volume 0     E                       DVD-ROM         0 B  No Media

I'm not sure if the ovf-env.xml was never mounted, or it was dismounted before cloudbase-init could process it? The full error message is below:

 2021-03-30 21:14:05.778 1780 ERROR cloudbaseinit.metadata.services.azureservice [-] No drive containing file E6DA6616-8EC4-48E0-BE93-58CE6ACE3CFB.tag could be found: cloudbaseinit.exception.ItemNotFoundException: 
No drive containing file E6DA6616-8EC4-48E0-BE93-58CE6ACE3CFB.tag could be found
2021-03-30 21:14:05.778 1780 ERROR cloudbaseinit.metadata.services.azureservice Traceback (most recent call last):
2021-03-30 21:14:05.778 1780 ERROR cloudbaseinit.metadata.services.azureservice   File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\metadata\services\azureservice.py", line 463, in load
2021-03-30 21:14:05.778 1780 ERROR cloudbaseinit.metadata.services.azureservice     self._get_ovf_env()
2021-03-30 21:14:05.778 1780 ERROR cloudbaseinit.metadata.services.azureservice   File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\metadata\services\azureservice.py", line 344, in _get_ovf_env
2021-03-30 21:14:05.778 1780 ERROR cloudbaseinit.metadata.services.azureservice     ovf_env_path = self._get_ovf_env_path()
2021-03-30 21:14:05.778 1780 ERROR cloudbaseinit.metadata.services.azureservice   File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\metadata\services\azureservice.py", line 332, in _get_ovf_env_path
2021-03-30 21:14:05.778 1780 ERROR cloudbaseinit.metadata.services.azureservice     base_path = self._get_config_set_drive_path()
2021-03-30 21:14:05.778 1780 ERROR cloudbaseinit.metadata.services.azureservice   File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\metadata\services\azureservice.py", line 328, in _get_config_set_drive_path
2021-03-30 21:14:05.778 1780 ERROR cloudbaseinit.metadata.services.azureservice     OVF_ENV_DRIVE_TAG)
2021-03-30 21:14:05.778 1780 ERROR cloudbaseinit.metadata.services.azureservice cloudbaseinit.exception.ItemNotFoundException: No drive containing file E6DA6616-8EC4-48E0-BE93-58CE6ACE3CFB.tag could be found

This is my cloudbase-init config:

[DEFAULT]
bsdtar_path=C:\Program Files\Cloudbase Solutions\Cloudbase-Init\bin\bsdtar.exe
mtools_path=C:\Program Files\Cloudbase Solutions\Cloudbase-Init\bin\

verbose=true
debug=true
logdir=C:\var\log\
logfile=cloudbase-init.log
default_log_levels=comtypes=INFO,suds=INFO,iso8601=WARN,requests=WARN

volumes_to_extend=2

config_drive_raw_hhd=false
config_drive_cdrom=false
config_drive_vfat=false
cdrom=false

first_logon_behaviour=no

volumes_to_extend=2
san_policy=OnlineAll
trim_enabled=True
ephemeral_disk_volume_label="Temporary Storage"

metadata_report_provisioning_started=True
metadata_report_provisioning_completed=True

metadata_services=cloudbaseinit.metadata.services.vmwareguestinfoservice.VMwareGuestInfoService,
        cloudbaseinit.metadata.services.azureservice.AzureService
plugins=cloudbaseinit.plugins.windows.extendvolumes.ExtendVolumesPlugin,
        cloudbaseinit.plugins.windows.sanpolicy.SANPolicyPlugin,
        cloudbaseinit.plugins.common.trim.TrimConfigPlugin,
        cloudbaseinit.plugins.common.ephemeraldisk.EphemeralDiskPlugin,
        cloudbaseinit.plugins.common.userdata.UserDataPlugin

allow_reboot=true
stop_service_on_exit=false
check_latest_version=false
edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
0

answered 2023-07-11 15:44:39 +0300

Nashwan Azhari gravatar image

first creating a vm from a 1909 Azure base image

Please note that 19.09 is out of service on both the Client and Server offerings.

I'd recommend switching either to a Server 2022-based image, or the Server 2019 18.09 LTS if you really need to stick to 2019.

I'm not sure if the ovf-env.xml was never mounted, or it was dismounted before cloudbase-init could process it?

You are correct in that Azure will neglect to serve metadata to any VM whose image it deems was not properly sysprepped to its standards. (most notably, whether it was properly "/generalized" or not)

Here is a working example of sysprep arguments known to produce Azure-palatable images.

sysprep.exe /oobe /generalize /mode:vm /quit /quiet /unattend:$UNATTEND_XML_PATH

The above was lifted from a colleague's repository which contains Azure image building configs for Packer, which should be a quick and repeatable way to build Cloudbase-init into your images.

If you'd like to run the Packer builds yourself, please examine the README of that repository, as well as the notes in this reply to a similar question which includes various tips. (like replacing the Cloudbase-init config file Packer will inject)

Please let us know how it goes!

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2021-03-31 01:03:36 +0300

Seen: 989 times

Last updated: Jul 11 '23