Calling Metadata in a customization script
Hi
i am currently trying to build a customization script that pulls variables from the meta data web service during initial boot and configuration but have run into an issue that causes the process to fail with an error 0 in the Cloudbase-init logs and i am wondering if i am doing something wrong or if there is a better way to do it.
basically the powershell customization script uses a invoke-webrequest to pull the meta object from the webservice then reads it a json and i extract the branches i want later in the script. code: $request = 'http://169.254.169.254/openstack/latest/meta_data.json' $meta = Invoke-WebRequest $request | ConvertFrom-Json | select -expand meta
from within a deployed VM this works as expected however during a instance build i have seen the following: Invoke-WebRequest : The response content cannot be parsed because the Internet \r\nExplorer engine is not available, or Internet Explorer's first-launch \r\nconfiguration is not complete. Specify the UseBasicParsing parameter and try \r\nagain. \r\nAt C:\Users\cloudbase-init\AppData\Local\Temp\d4a44534-80d5-485a-b451-95833cf4f\r\n9c4.ps1:8 char:9\r\n+
I am wondering if there is a better way to pull the meta data i have added to the VM for the customization (is there a way to call directly via a customization script?) or is there a known work around ?
for reference i am using the cloudbase 2012 R2 image on a KVM backed Ubuntu Openstack
many thanks
James