cloudstack-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sergey Levitskiy <Sergey.Levits...@autodesk.com>
Subject Re: configdrive in ACS
Date Sun, 11 Sep 2016 15:30:34 GMT
ACS uses a different system than configdrive. Userdata and metadata is saved on a vrouter and
can be queried from the instance with basic HTTP call. It is very similar to AWS.
To save userdata you would use deployVirtualMachine or updateVirtualMachine call
Use this guide for details how format encode it:
http://docs.cloudstack.apache.org/projects/cloudstack-administration/en/4.8/virtual_machines/user-data.html

Here it is an example how you would get VM ID and some random property from metadata and userdata
assuming userdata has propertyname:”propertyvalue” style tag inside

if [[ $OS == "RHEL" || $OS == "CentOS" ]]; then
  DHCPBASE="/var/lib/dhclient/dhclient-*.lease"
elif [ $OS == "Ubuntu" ]; then
  DHCPBASE="/var/lib/dhcp/dhclient.*.leases"
fi

DHCPSERVER=`grep dhcp-server-identifier $DHCPBASE |tail -1|awk '{print $3}'|sed 's/;//'`
IPADDRESS=`curl -s http://$DHCPSERVER/latest/local-ipv4`
PROVIDERID=`curl -s http://$DHCPSERVER/latest/vm-id|sed '/^i-.*/s/i-[0-9]*-//'|sed 's/-VM$//'|sed
'/[0-9a-f]\{8\}-[0-9a-f]\{4\}-[0-9a-f]\{4\}-[0-9a-f]\{4\}-[0-9a-f]\{12\}/s/-[0-9a-f]\{4\}-[0-9a-f]\{4\}-[0-9a-f]\{4\}-[0-9a-f]\{12\}$//'`

PROPERTYVALUE=`curl -s http://$DHCPSERVER/latest/user-data|grep propertyname|cut -d":" -f2|cut
-d'"' -f2`






On 9/11/16, 3:36 AM, "Helge Waastad" <helge@waastad.org> wrote:

    Hi,
    Im testing out RancherOS in ACS and have a couple of issues.
    
    First, it seems that RancherOS does not support cloudstack datasource for meta/userdata
but that I need to take with Rancher guys.
    
    But, in openstack I can always use configdrive to get userdata to my vm.
    
    Is it possible to use configdrive in acs? (i have'nt had any luck yet)
    
    Br hw
    
    
    
    
    Sendt fra Galaxy Tab


Mime
View raw message