summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorBrent Baude <bbaude@redhat.com>2016-08-10 16:36:49 -0600
committerScott Moser <smoser@brickies.net>2016-08-15 10:16:19 -0400
commit648dbbf6b090c81e989f1ab70bf99f4de16a6a70 (patch)
treec69218dffe430477054483edd7876cc56b902370 /doc
parentbc2c3267549b9067c017a34e22bbee18890aec06 (diff)
downloadvyos-cloud-init-648dbbf6b090c81e989f1ab70bf99f4de16a6a70.tar.gz
vyos-cloud-init-648dbbf6b090c81e989f1ab70bf99f4de16a6a70.zip
Get Azure endpoint server from DHCP client
It is more efficient and cross-distribution safe to use the hooks function from dhclient to obtain the Azure endpoint server (DHCP option 245). This is done by providing shell scritps that are called by the hooks infrastructure of both dhclient and NetworkManager. The hooks then invoke 'cloud-init dhclient-hook' that maintains json data with the dhclient options in /run/cloud-init/dhclient.hooks/<interface>.json . The azure helper then pulls the value from /run/cloud-init/dhclient.hooks/<interface>.json file(s). If that file does not exist or the value is not present, it will then fall back to the original method of scraping the dhcp client lease file.
Diffstat (limited to 'doc')
-rw-r--r--doc/sources/azure/README.rst32
1 files changed, 28 insertions, 4 deletions
diff --git a/doc/sources/azure/README.rst b/doc/sources/azure/README.rst
index 8239d1fa..48f3cc7a 100644
--- a/doc/sources/azure/README.rst
+++ b/doc/sources/azure/README.rst
@@ -9,10 +9,34 @@ Azure Platform
The azure cloud-platform provides initial data to an instance via an attached
CD formated in UDF. That CD contains a 'ovf-env.xml' file that provides some
information. Additional information is obtained via interaction with the
-"endpoint". The ip address of the endpoint is advertised to the instance
-inside of dhcp option 245. On ubuntu, that can be seen in
-/var/lib/dhcp/dhclient.eth0.leases as a colon delimited hex value (example:
-``option unknown-245 64:41:60:82;`` is 100.65.96.130)
+"endpoint".
+
+To find the endpoint, we now leverage the dhcp client's ability to log its
+known values on exit. The endpoint server is special DHCP option 245.
+Depending on your networking stack, this can be done
+by calling a script in /etc/dhcp/dhclient-exit-hooks or a file in
+/etc/NetworkManager/dispatcher.d. Both of these call a sub-command
+'dhclient_hook' of cloud-init itself. This sub-command will write the client
+information in json format to /run/cloud-init/dhclient.hook/<interface>.json.
+
+In order for cloud-init to leverage this method to find the endpoint, the
+cloud.cfg file must contain:
+
+datasource:
+ Azure:
+ set_hostname: False
+ agent_command: __builtin__
+
+If those files are not available, the fallback is to check the leases file
+for the endpoint server (again option 245).
+
+You can define the path to the lease file with the 'dhclient_lease' configuration
+value under system_info: and paths:. For example:
+
+ dhclient_lease: /var/lib/dhcp/dhclient.eth0.leases
+
+If no configuration value is provided, the dhclient_lease value will fallback to
+/var/lib/dhcp/dhclient.eth0.leases.
walinuxagent
------------