cloudstack/server/test/com/cloud/vpc
Rohit Yadav 4c86b1545d CLOUDSTACK-424: Update userdata should propagate to VR
The code that would propage userdata to router, when updateVirtualMachine api
is called, was missing. As per the docs [0], userdata should be a base64 encoded
string upto 2KB which is put on domr's html directory adn using HTTP GET the
userdata information can be obtained from the domr.

The updateVirtualMachine api [0] would accept a base64 encoded string
and decoded and put into the domr's /var/www/html/userdata/<uservm ip>/user-data
file. The operation does not require the VM to be in stopped state, though it is
advised to stop and call this api in case the user vm has a script which gets
the userdata information from domr while starting.

For example, this script can be used to fetch the data:
server_ip=$(grep dhcp-server-identifier /var/lib/dhclient-eth0.leases | tail -1 | awk '{print $NF}' | tr '\;' ' ')
wget http://${server_ip}/latest/user-data

This feature can be useful, for example to use into puppet facts [1], or to do
automation and horizontal scaling etc. based on userdata.

[0] http://incubator.apache.org/cloudstack/docs/api/apidocs-4.0.0/domain_admin/updateVirtualMachine.html
[1] http://geek.jasonhancock.com/2011/11/09/cloudstack-userdata-into-puppet-facts/

BUG-ID : CLOUDSTACK-424
Reviewed-by: Rohit Yadav <bhaisaab@apache.org>
Reported-by: Nick Wales

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-11-15 18:43:51 +05:30
..
dao CLOUDSTACK-279: fixed deleteProject when executed by the regular user. Always pass System account as a caller when do account cleanup 2012-10-17 17:26:19 -07:00
MockConfigurationManagerImpl.java Fixed unittest 2012-09-11 17:26:20 -07:00
MockNetworkManagerImpl.java CLOUDSTACK-424: Update userdata should propagate to VR 2012-11-15 18:43:51 +05:30
MockResourceLimitManagerImpl.java Patch from Gavin Lee: Change license to ASL2.0 in server and tools 2012-08-30 10:36:29 -04:00
MockSite2SiteVpnManagerImpl.java CS-16412: fixed count for following commands: 2012-10-15 18:16:59 -07:00
MockVpcManagerImpl.java CLOUDSTACK-279: fixed deleteProject when executed by the regular user. Always pass System account as a caller when do account cleanup 2012-10-17 17:26:19 -07:00
VpcApiUnitTest.java CLOUDSTACK-279: fixed deleteProject when executed by the regular user. Always pass System account as a caller when do account cleanup 2012-10-17 17:26:19 -07:00