get_network_details_v2 implementation should be consistent with
the base metadata service implementation.
The method should return None in case the underlying metadata
does not exist or if it is invalid.
Change-Id: Ida3fe780f22dc20db6bd8ed3f43728a2671b46da
Closes-Bug: #1796053
Includes support for static networking, bonds and VLANs.
Implements: blueprint maas-network-config
Co-Authored-By: Adrian Vladu <avladu@cloudbasesolutions.com>
Change-Id: If0949ecfc3ec0cb65d4cd89cffd3055a110e737e
The original network processing is retained for metadata services
that don't implement get_network_details_v2.
Partially-Implements: blueprint json-network-config
Change-Id: Ie2cee13211bc52f69104875803dbc283b3d8e38d
Co-Authored-By: Adrian Vladu <avladu@cloudbasesolutions.com>
A simple way to get an adapter name given the MAC address. This is needed
since the MAC address is used to uniquely identify NICs based on
information provided by metadata services.
get_network_adapter_name_by_mac_address raises in case no adapters or
multiple adapters with the same MAC are found.
Change-Id: Ie17ee65445dc55a5946653ece1fef68ad7b87aba
Partially-Implements: blueprint json-network-config
Change set_static_network_config in order to work with recent
Windows versions as well.
Partially-Implements: blueprint json-network-config
Change-Id: Ie916d658265ca2895afcdebeaa5ae82d48b90082
On Windows two main options are available to create network
adapter teams: NetLBFO (starting with Windows Server 2012) and
SET (starting with Windows Server 2016, requiring a VMSwitch).
This patch adds support for for NetLBFO.
Partially-Implements: blueprint json-network-config
Change-Id: Id80d24db0239acb8cb9d3ba5f9eaca1191957f1a
Co-Authored-By: Adrian Vladu <avladu@cloudbasesolutions.com>
Since PyMI requires the MI API, available only since Windows 8 /
Windows Server 2012 or as an addon on some previous versions, we
need to ensure that we fall back to the legacy WMI module if PyMI
cannot be loaded.
Partially-Implements: blueprint json-network-config
Change-Id: Ibded4cee3d3d7dc39e53bca12e015c9ef83c7f3d
When using bonds and VLANs, multiple NICs can have the same
MAC address. This patch replaces the MAC address with the name
as a unique network adapter identifier.
Partially-Implements: blueprint json-network-config
Change-Id: Id1a32e8dfa4322edbc579e96e76a23965f19345b
This is needed to identify the NIC when multiple adapters share the same
MAC address, e.g. when bonds or VLAN NICs are present.
Change-Id: I5dc63fd06e03c005e1f2190e84444720723a5de6
Partially-Implements: blueprint json-network-config
Needed in osutils for renaming network adapters based
on the metadata network configuration.
Partially-Implements: blueprint json-network-config
Change-Id: I0d3fb842b39388d2f04abe3e2c3adc988c3e4dbe
Change get_network_adapters in the Windows osutils to return
NetConnectionID from the Win32_NetworkAdapter WMI query in
place of Name.
Different Windows API use different naming to identify the name and
description of a network adapter.
In the case of Win32_NetworkAdapter, NetConnectionID is the actual
name (e.g. Ethernet1) while Name is the description (e.g. Microsoft
Hyper-V Network Adapter).
Partially-Implements: blueprint json-network-config
Change-Id: I3e690a9e0b763e9829a3eddd91a47454d3eb1df8
The following issue happens when trying to extend volumes using VDS:
OSError: [WinError -2147417850] Cannot change thread mode after it
is set
sys.coinit_flags needs to be set before importing pythoncom.
Change-Id: I83877219b9589d9c174fd3a245b644350ea6310a
Closes-Bug: #1787659
Retrieving the MAC address fails when there are interfaces that
don't have a AF_INET address.
Change-Id: I1e7f4bd897e8e2a0b79f16326f59f2495b946b80
Closes-Bug: #1787361
New mkfs.vfat and fatlabel tools included in the dosfsutils package no
longer support creating vfat disks with lowercase labels. They silently
default to an all uppercase label eg CONFIG-2 instead of config-2. This
change makes cloud-init handle either upper or lower case.
Change-Id: Iec927db04b9621b20c9bee2c8d81325d7af80f9b
Closes-Bug: #1598783
If a cloud-config content is empty or it contains
a comment, cloudbase-init will error out.
This commit addresses this failure by throwing a
CloudConfigError that is caught later in the
execution chain.
Change-Id: Ifd209ca362e62b2fc6ce4e631fc9e77da8aca745
Add configurable option for the user password length of the user
defined by the `username` config option. The following parameter
has been added:
- user_password_length: type=int, default=20
The current default password length is 20, making it cumbersome for
users to enter the lengthy password via console.
Change-Id: I37ae75a438f6fd326101c7b8a855c1f39dd1e804
Closes-bug: #1684119
Some of the keys of the currently supported cloud-config plugins are not
the same as the ones used by cloud-init. This patch adds the correct keys
for the cloud-config plugins.
Change-Id: I901acb330f934b6144ff69f4f65d6053dfb8fe1b
According to [1], Content-Transfer-Encoding can have one of the
following values (case insensitive): "BASE64" / "QUOTED-PRINTABLE" /
"8BIT" / "7BIT" / "BINARY" / x-token.
Values "8bit", "7bit", and "binary" all imply that NO encoding has been
performed.
"x-token" refers to a custom implementation that can be done, where the
encoding agent and the decoding agent must agree upon. This case is not
addressed by the patch.
"QUOTED-PRINTABLE" and "base64" encodings are addressed by this patch,
and the decoding is performed for all the multipart content types
currently supported.
[1]https://www.w3.org/Protocols/rfc1341/5_Content-Transfer-Encoding.html
Change-Id: Iac29f3a287bd478f7f0b55d9911ae47f3a5890fb
Closes-Bug: #1696420
When using serial ports for logging, an infinite recursion occurs if the
serial port cannot be opened.
The solution is to add the serial port log handler only after the serial
port has been opened successfully.
Closes-bug: #1692888
Change-Id: Ifb2352292dd31869ee6d5ff83fe53584dd684ebd
Adds the Azure guest agent plugin which configures the
WindowsAzureGuestAgent, WindowsAzureTelemetryService and
RdAgent services.
Change-Id: I713c2b17bb083767272cefa2bf517ff1a0cbb992
Co-Authored-By: Stefan Caraiman <scaraiman@cloudbasesolutions.com>
Implements: blueprint add-azure-guest-plugin
The following patch implements the support for the Azure metadata service
Co-Authored-By: Paula Madalina Crismaru <pcrismaru@cloudbasesolutions.com>
Change-Id: I5da5152ed04c54a9777191defc10b4d7023313f5
Implements: blueprint azure-metadata-service
Install all the certificates provided by the metadata.
Change-Id: Ida2550a10fa043e40b194db5d0db10692e716edf
Implements: add-certificates-plugin
Co-Authored-By: Paula Madalina Crismaru <pcrismaru@cloudbasesolutions.com>
This plugin is implemented for Azure, and its purpose it's to copy a given
file on the specified partition, if the following options are configured:
- ephemeral_disk_volume_label: Ephemeral disk volume label
- ephemeral_disk_volume_mount_point: Ephemeral disk volume mount point
- ephemeral_disk_data_loss_warning_path: Ephemeral disk data loss warning path,
relative to the ephemeral disk volume path
Change-Id: Ieadf5699f71deb22cb791324e3d32310be1e8bd5
Implements: add-ephemeral-disk-plugin
Co-Authored-By: Paula Madalina Crismaru <pcrismaru@cloudbasesolutions.com>
In version 4.0.0 of oslo.config the type of the values given in the
config file is verified to see if it corresponds with the type declared.
Some unit tests used values with different types for the config
parameters.
Change-Id: I013d0689d8adf832f97cbfb008463711df928cae
Add support for executing userdata when using the EC2 metadata service.
Change-Id: Ie9896fb50eab6cf9c4803a92313cae1854aeeeba
Implements: blueprint user-data-support-for-aws
Add support for reporting the provisioning status to the metadata
service.
The following config options have been added:
- metadata_report_provisioning_started: Reports to the metadata service
that provisioning has started
type=bool, default=False
- metadata_report_provisioning_completed: Reports to the metadata
service that provisioning completed or failed
type=bool, default=False
Change-Id: I23a5a8e5473dd103ce5e0acd0c4647cdec86f97f
Implements: blueprint add-reporting-provisioning-status-to-metadata-service
Co-Authored-By: Paula Madalina Crismaru <pcrismaru@cloudbasesolutions.com>
Adds a plugin to configure Windows automatic updates.
The automatic updates configuration is retrieved
from the metadata service, or, if not set in the metadata,
from the config option "enable_automatic_updates".
The possible values for the config option are:
- Not set (None): no updates policy is configured
- True: updates are automatically installed
- False: updates are disabled on the system
Implements: blueprint windows-automated-updates-plugin
Co-Authored-By: Stefan Caraiman <scaraiman@cloudbasesolutions.com>
Co-Authored-By: Adrian Vladu <avladu@cloudbasesolutions.com>
Change-Id: Ida07a3a279321fe434a82a5123338679ec4506df
Signed-off-by: Stefan Caraiman <scaraiman@cloudbasesolutions.com>
The 'exec_file' will now try to check for the headers inside the file, in
case that it doesn't recognize the format or no format has been provided.
Also the processing part of the user data now checks if the 'Content-Type' is
in the file instead of checking if the file starts with the header, in
order to comply with RFC2045.
Change-Id: I53fda9f5c17f35cb35d93a86434ecc4c7c579802
Closes-Bug: #1623393
Closes-Bug: #1672222