From 35779c6675728fa6f0fd0a21cefb904408509c23 Mon Sep 17 00:00:00 2001 From: Sebastien Bacher Date: Mon, 5 Jul 2021 20:35:03 +0200 Subject: New upstream version 1.32.2 --- docs/api/html/nm-cloud-setup.html | 57 ++++++++++++++++++++++++++++++--------- 1 file changed, 45 insertions(+), 12 deletions(-) (limited to 'docs/api/html/nm-cloud-setup.html') diff --git a/docs/api/html/nm-cloud-setup.html b/docs/api/html/nm-cloud-setup.html index 13bc2d74..54d53b56 100644 --- a/docs/api/html/nm-cloud-setup.html +++ b/docs/api/html/nm-cloud-setup.html @@ -29,7 +29,7 @@
-

Overview

+

Overview

When running a virtual machine in a public cloud environment, it is desirable to automatically configure the network of that VM. In simple setups, the VM only has one network interface and the public @@ -44,7 +44,7 @@

Multiple cloud providers are supported. See the section called “Supported Cloud Providers”.

-

Use

+

Use

The goal of nm-cloud-setup is to be configuration-less and work automatically. All you need is to opt-in to the desired cloud providers (see the section called “Environment Variables”) and run /usr/libexec/nm-cloud-setup.

@@ -53,7 +53,7 @@ and a NetworkManager dispatcher script.

-

Details

+

Details

nm-cloud-setup configures the network by fetching the configuration from the well-known meta data server of the cloud provider. That means, it already @@ -74,7 +74,7 @@ With this approach, the configuration is not persisted and only preserved until the device disconnects.

-

/usr/libexec/nm-cloud-setup

+

/usr/libexec/nm-cloud-setup

The binary /usr/libexec/nm-cloud-setup does most of the work. It supports no command line arguments but can be configured via environment variables. @@ -94,7 +94,7 @@


-

nm-cloud-setup.service systemd unit

+

nm-cloud-setup.service systemd unit

Usually /usr/libexec/nm-cloud-setup is not run directly, but only by systemctl restart nm-cloud-setup.service. This ensures that the tool only runs once at any time. It also allows to integrate @@ -105,7 +105,7 @@


-

nm-cloud-setup.timer systemd timer

+

nm-cloud-setup.timer systemd timer

/usr/libexec/nm-cloud-setup is intended to run whenever an update is necessary. For example, during boot when when changing the network configuration of the virtual machine via the cloud @@ -115,7 +115,7 @@


-

/usr/lib/NetworkManager/dispatcher.d/90-nm-cloud-setup.sh

+

/usr/lib/NetworkManager/dispatcher.d/90-nm-cloud-setup.sh

There is also a NetworkManager dispatcher script that will run for example when an interface is activated by NetworkManager. Together with the nm-cloud-setup.timer systemd timer this @@ -147,9 +147,40 @@

+

Example Setup for Configuring and Predeploying nm-cloud-setup

+

As detailed before, nm-cloud-setup needs to be explicitly enabled. As it + runs as a systemd service and timer, that basically means to enable and configure + those. This can be done by dropping the correct files and symlinks to disk. +

+

+ The following example enables nm-cloud-setup for Amazon EC2 cloud: +

+
+dnf install -y NetworkManager-cloud-setup
+
+mkdir -p /etc/systemd/system/nm-cloud-setup.service.d
+cat > /etc/systemd/system/nm-cloud-setup.service.d/10-enable-ec2.conf << EOF
+[Service]
+Environment=NM_CLOUD_SETUP_EC2=yes
+EOF
+
+# systemctl enable nm-cloud-setup.service
+mkdir -p /etc/systemd/system/NetworkManager.service.wants/
+ln -s /usr/lib/systemd/system/nm-cloud-setup.service /etc/systemd/system/NetworkManager.service.wants/nm-cloud-setup.service
+
+# systemctl enable nm-cloud-setup.timer
+mkdir -p /etc/systemd/system/timers.target.wants/
+ln -s /etc/systemd/system/timers.target.wants/nm-cloud-setup.timer /usr/lib/systemd/system/nm-cloud-setup.timer
+
+# systemctl daemon-reload
+      
+

+

+
+

Supported Cloud Providers

-

Amazon EC2 (AWS)

+

Amazon EC2 (AWS)

For AWS, the tools tries to fetch configuration from http://169.254.169.254/. Currently, it only configures IPv4 and does nothing about IPv6. It will do the following.

    @@ -192,7 +223,7 @@

-

Google Cloud Platform (GCP)

+

Google Cloud Platform (GCP)

For GCP, the meta data is fetched from URIs starting with http://metadata.google.internal/computeMetadata/v1/ with a HTTP header "Metadata-Flavor: Google". @@ -220,7 +251,7 @@


-

Microsoft Azure

+

Microsoft Azure

For Azure, the meta data is fetched from URIs starting with http://169.254.169.254/metadata/instance with a URL parameter "?format=text&api-version=2017-04-02" and a HTTP header "Metadata:true". @@ -238,7 +269,9 @@

  • Then, for each IP address index fetch the address at http://169.254.169.254/metadata/instance/network/interface/$IFACE_INDEX/ipv4/ipAddress/$ADDR_INDEX/privateIpAddress?format=text&api-version=2017-04-02. - Also fetch the size of the subnet (the netmask) for the interface from + Also fetch the size of the subnet and prefix for the interface from + http://169.254.169.254/metadata/instance/network/interface/$IFACE_INDEX/ipv4/subnet/0/address/?format=text&api-version=2017-04-02. + and http://169.254.169.254/metadata/instance/network/interface/$IFACE_INDEX/ipv4/subnet/0/prefix/?format=text&api-version=2017-04-02.

  • @@ -256,7 +289,7 @@
  • -

    See Also

    +

    See Also

    NetworkManager(8) nmcli(1) -- cgit 1.3.0-6-gf8a5