diff --git a/.WALinuxAgent.metadata b/.WALinuxAgent.metadata index 89437dc..38bd7d7 100644 --- a/.WALinuxAgent.metadata +++ b/.WALinuxAgent.metadata @@ -1 +1 @@ -45d136023c003b28a9b49fd89e6c9570b38fb397 SOURCES/WALinuxAgent-2.2.38.tar.gz +6a636c47aea02063bde8282a5bc2bb61d4afe640 SOURCES/WALinuxAgent-2.2.46.tar.gz diff --git a/.gitignore b/.gitignore index 4e971d7..a773e1c 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/WALinuxAgent-2.2.38.tar.gz +SOURCES/WALinuxAgent-2.2.46.tar.gz diff --git a/SOURCES/0002-Remove-FIPS-setting-from-the-default-config.patch b/SOURCES/0002-Remove-FIPS-setting-from-the-default-config.patch index afbe0de..4f89667 100644 --- a/SOURCES/0002-Remove-FIPS-setting-from-the-default-config.patch +++ b/SOURCES/0002-Remove-FIPS-setting-from-the-default-config.patch @@ -1,4 +1,4 @@ -From fffefe2a2405d3f6343a0b3cc8ff863215379c2c Mon Sep 17 00:00:00 2001 +From cbf8baa1ce97d15ab16e27d21e4e7a74f79a0383 Mon Sep 17 00:00:00 2001 From: Miroslav Rezanina Date: Tue, 4 Jul 2017 08:33:29 +0200 Subject: Remove FIPS setting from the default config diff --git a/SOURCES/wla-Add-support-for-Gen2-VM-resource-disks-1654.patch b/SOURCES/wla-Add-support-for-Gen2-VM-resource-disks-1654.patch deleted file mode 100644 index 74bfea5..0000000 --- a/SOURCES/wla-Add-support-for-Gen2-VM-resource-disks-1654.patch +++ /dev/null @@ -1,193 +0,0 @@ -From e3ad16e0f5bd0dfa172647b4fc3213b9e119fdb3 Mon Sep 17 00:00:00 2001 -From: Vitaly Kuznetsov -Date: Fri, 7 Feb 2020 12:19:12 +0100 -Subject: [PATCH] Add support for Gen2 VM resource disks (#1654) - -RH-Author: Vitaly Kuznetsov -Message-id: <20200207121912.720071-1-vkuznets@redhat.com> -Patchwork-id: 93767 -O-Subject: [RHEL7 WALinuxAgent PATCH] Add support for Gen2 VM resource disks (#1654) -Bugzilla: 1714167 -RH-Acked-by: Miroslav Rezanina -RH-Acked-by: Eduardo Otubo - -Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1714167 -Brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=26270155 -Branch: rhel7/master-2.2.38 -Tested: Gen1 by me, Gen2 by QE - -Upstream commit besides fixing the issue does a lot of unrelated -changes and these don't backport cleanly to 2.2.38, let's just drop -them for now. In case we decide to rebase WALinuxAgent later in RHEL7 -lifetime this backport can just be dropped. - -commit 93ecdc451d74165c25e40985a20a8fcfbfe55d57 -Author: Thomas Stringer -Date: Mon Oct 21 14:20:27 2019 -0400 - - Add support for Gen2 VM resource disks (#1654) - - * (wip) add gen2 resource disk support - - * remove device names - - * move device id constant - - * add debian testing and unstable support - - * add tests for resource disk discovery - - * remove unnecessary patch for test - - * refactor checking for both gen devices - - * rename debian util classes to reflect current - - * catch file not found errors for older python versions - - * refactor out filesystem search for device - - * fix typo - - * remove newline from input string - - * refactor device enumeration to own method - - * fix bug with breaking from loop - -Signed-off-by: Miroslav Rezanina - -Conflicts: - azurelinuxagent/common/osutil/debian.py - azurelinuxagent/common/osutil/factory.py - tests/common/osutil/test_default.py - tests/common/osutil/test_factory.py - -Drop all changes unrelated to the resource disk issue. Drop test hunks -as they don't apply cleanly and to simplify future (possible) rebase (and -because we don't run these tests anyway). - -Signed-off-by: Vitaly Kuznetsov ---- - azurelinuxagent/common/osutil/default.py | 91 ++++++++++++++++++++++++-------- - 1 file changed, 70 insertions(+), 21 deletions(-) - -diff --git a/azurelinuxagent/common/osutil/default.py b/azurelinuxagent/common/osutil/default.py -index 189d8fe..daf1b70 100644 ---- a/azurelinuxagent/common/osutil/default.py -+++ b/azurelinuxagent/common/osutil/default.py -@@ -97,6 +97,8 @@ IP_COMMAND_OUTPUT = re.compile('^\d+:\s+(\w+):\s+(.*)$') - - BASE_CGROUPS = '/sys/fs/cgroup' - -+STORAGE_DEVICE_PATH = '/sys/bus/vmbus/devices/' -+GEN2_DEVICE_ID = 'f8b3781a-1e82-4818-a1c3-63d806ec15bb' - - class DefaultOSUtil(object): - def __init__(self): -@@ -1167,6 +1169,67 @@ class DefaultOSUtil(object): - return tokens[2] if len(tokens) > 2 else None - return None - -+ @staticmethod -+ def _enumerate_device_id(): -+ """ -+ Enumerate all storage device IDs. -+ -+ Args: -+ None -+ -+ Returns: -+ Iterator[Tuple[str, str]]: VmBus and storage devices. -+ """ -+ -+ if os.path.exists(STORAGE_DEVICE_PATH): -+ for vmbus in os.listdir(STORAGE_DEVICE_PATH): -+ deviceid = fileutil.read_file(os.path.join(STORAGE_DEVICE_PATH, vmbus, "device_id")) -+ guid = deviceid.strip('{}\n') -+ yield vmbus, guid -+ -+ @staticmethod -+ def search_for_resource_disk(gen1_device_prefix, gen2_device_id): -+ """ -+ Search the filesystem for a device by ID or prefix. -+ -+ Args: -+ gen1_device_prefix (str): Gen1 resource disk prefix. -+ gen2_device_id (str): Gen2 resource device ID. -+ -+ Returns: -+ str: The found device. -+ """ -+ -+ device = None -+ # We have to try device IDs for both Gen1 and Gen2 VMs. -+ logger.info('Searching gen1 prefix {0} or gen2 {1}'.format(gen1_device_prefix, gen2_device_id)) -+ try: -+ for vmbus, guid in DefaultOSUtil._enumerate_device_id(): -+ if guid.startswith(gen1_device_prefix) or guid == gen2_device_id: -+ for root, dirs, files in os.walk(STORAGE_DEVICE_PATH + vmbus): -+ root_path_parts = root.split('/') -+ # For Gen1 VMs we only have to check for the block dir in the -+ # current device. But for Gen2 VMs all of the disks (sda, sdb, -+ # sr0) are presented in this device on the same SCSI controller. -+ # Because of that we need to also read the LUN. It will be: -+ # 0 - OS disk -+ # 1 - Resource disk -+ # 2 - CDROM -+ if root_path_parts[-1] == 'block' and ( -+ guid != gen2_device_id or -+ root_path_parts[-2].split(':')[-1] == '1'): -+ device = dirs[0] -+ return device -+ else: -+ # older distros -+ for d in dirs: -+ if ':' in d and "block" == d.split(':')[0]: -+ device = d.split(':')[1] -+ return device -+ except (OSError, IOError) as exc: -+ logger.warn('Error getting device for {0} or {1}: {2}', gen1_device_prefix, gen2_device_id, ustr(exc)) -+ return None -+ - def device_for_ide_port(self, port_id): - """ - Return device name attached to ide port 'n'. -@@ -1177,27 +1240,13 @@ class DefaultOSUtil(object): - if port_id > 1: - g0 = "00000001" - port_id = port_id - 2 -- device = None -- path = "/sys/bus/vmbus/devices/" -- if os.path.exists(path): -- try: -- for vmbus in os.listdir(path): -- deviceid = fileutil.read_file(os.path.join(path, vmbus, "device_id")) -- guid = deviceid.lstrip('{').split('-') -- if guid[0] == g0 and guid[1] == "000" + ustr(port_id): -- for root, dirs, files in os.walk(path + vmbus): -- if root.endswith("/block"): -- device = dirs[0] -- break -- else: -- # older distros -- for d in dirs: -- if ':' in d and "block" == d.split(':')[0]: -- device = d.split(':')[1] -- break -- break -- except OSError as oe: -- logger.warn('Could not obtain device for IDE port {0}: {1}', port_id, ustr(oe)) -+ -+ gen1_device_prefix = '{0}-000{1}'.format(g0, port_id) -+ device = DefaultOSUtil.search_for_resource_disk( -+ gen1_device_prefix=gen1_device_prefix, -+ gen2_device_id=GEN2_DEVICE_ID -+ ) -+ logger.info('Found device: {0}'.format(device)) - return device - - def set_hostname_record(self, hostname): --- -1.8.3.1 - diff --git a/SOURCES/wla-Update-Provisioning-options-1853.patch b/SOURCES/wla-Update-Provisioning-options-1853.patch new file mode 100644 index 0000000..3807b74 --- /dev/null +++ b/SOURCES/wla-Update-Provisioning-options-1853.patch @@ -0,0 +1,351 @@ +From 3453fe9b9a85d755262f68ef96e2570917b67755 Mon Sep 17 00:00:00 2001 +From: Vitaly Kuznetsov +Date: Wed, 3 Jun 2020 12:21:07 +0200 +Subject: [PATCH] Update 'Provisioning' options (#1853) + +RH-Author: Vitaly Kuznetsov +Message-id: <20200525162420.151669-1-vkuznets@redhat.com> +Patchwork-id: 96748 +O-Subject: [RHEL7.9 WALinuxAgent PATCH] Update 'Provisioning' options (#1853) +Bugzilla: 1822883 +RH-Acked-by: Mohammed Gamal +RH-Acked-by: Miroslav Rezanina + +commit 92b652e031dd01027113702df7ee93c816bfd1aa +Author: Vitaly Kuznetsov +Date: Tue Apr 21 02:01:03 2020 +0200 + + Update 'Provisioning' options (#1853) + + 'Provisioning.Enabled' and 'Provisioning.UseCloudInit' parameters are + removed since v2.2.45 and replaced with 'Provisioning.Agent'. Update + distro specific configs accordingly. + + Signed-off-by: Vitaly Kuznetsov + + Co-authored-by: Vitaly Kuznetsov + +Signed-off-by: Vitaly Kuznetsov +Signed-off-by: Miroslav Rezanina +--- + config/alpine/waagent.conf | 8 +++----- + config/arch/waagent.conf | 8 +++----- + config/bigip/waagent.conf | 8 +++----- + config/clearlinux/waagent.conf | 8 +++----- + config/coreos/waagent.conf | 8 +++----- + config/debian/waagent.conf | 8 +++----- + config/freebsd/waagent.conf | 8 +++----- + config/gaia/waagent.conf | 8 +++----- + config/iosxe/waagent.conf | 8 +++----- + config/nsbsd/waagent.conf | 8 +++----- + config/openbsd/waagent.conf | 8 +++----- + config/suse/waagent.conf | 8 +++----- + config/ubuntu/waagent.conf | 8 +++----- + config/waagent.conf | 8 +++----- + 14 files changed, 42 insertions(+), 70 deletions(-) + +diff --git a/config/alpine/waagent.conf b/config/alpine/waagent.conf +index ac9466e..2a010cf 100644 +--- a/config/alpine/waagent.conf ++++ b/config/alpine/waagent.conf +@@ -2,15 +2,13 @@ + # Windows Azure Linux Agent Configuration + # + +-# Enable instance creation +-Provisioning.Enabled=y +- + # Enable extension handling. Do not disable this unless you do not need password reset, + # backup, monitoring, or any extension handling whatsoever. + Extensions.Enabled=y + +-# Rely on cloud-init to provision +-Provisioning.UseCloudInit=n ++# Which provisioning agent to use. Supported values are "auto" (default), "waagent", ++# "cloud-init", or "disabled". ++Provisioning.Agent=auto + + # Password authentication for root account will be unavailable. + Provisioning.DeleteRootPassword=y +diff --git a/config/arch/waagent.conf b/config/arch/waagent.conf +index 8d509cf..f999359 100644 +--- a/config/arch/waagent.conf ++++ b/config/arch/waagent.conf +@@ -2,11 +2,9 @@ + # Microsoft Azure Linux Agent Configuration + # + +-# Enable instance creation +-Provisioning.Enabled=y +- +-# Rely on cloud-init to provision +-Provisioning.UseCloudInit=n ++# Which provisioning agent to use. Supported values are "auto" (default), "waagent", ++# "cloud-init", or "disabled". ++Provisioning.Agent=auto + + # Password authentication for root account will be unavailable. + Provisioning.DeleteRootPassword=n +diff --git a/config/bigip/waagent.conf b/config/bigip/waagent.conf +index 7446bcb..49acf9d 100644 +--- a/config/bigip/waagent.conf ++++ b/config/bigip/waagent.conf +@@ -13,15 +13,13 @@ Role.ConfigurationConsumer=None + # Specified program is invoked with XML file argument specifying role topology. + Role.TopologyConsumer=None + +-# Enable instance creation +-Provisioning.Enabled=y +- + # Enable extension handling. Do not disable this unless you do not need password reset, + # backup, monitoring, or any extension handling whatsoever. + Extensions.Enabled=y + +-# Rely on cloud-init to provision +-Provisioning.UseCloudInit=n ++# Which provisioning agent to use. Supported values are "auto" (default), "waagent", ++# "cloud-init", or "disabled". ++Provisioning.Agent=auto + + # Password authentication for root account will be unavailable. + Provisioning.DeleteRootPassword=y +diff --git a/config/clearlinux/waagent.conf b/config/clearlinux/waagent.conf +index 10567cc..0b70d26 100644 +--- a/config/clearlinux/waagent.conf ++++ b/config/clearlinux/waagent.conf +@@ -13,11 +13,9 @@ Role.ConfigurationConsumer=None + # Specified program is invoked with XML file argument specifying role topology. + Role.TopologyConsumer=None + +-# Enable instance creation +-Provisioning.Enabled=y +- +-# Rely on cloud-init to provision +-Provisioning.UseCloudInit=n ++# Which provisioning agent to use. Supported values are "auto" (default), "waagent", ++# "cloud-init", or "disabled". ++Provisioning.Agent=auto + + # Password authentication for root account will be unavailable. + Provisioning.DeleteRootPassword=y +diff --git a/config/coreos/waagent.conf b/config/coreos/waagent.conf +index 8d3312c..0ce7b27 100644 +--- a/config/coreos/waagent.conf ++++ b/config/coreos/waagent.conf +@@ -2,15 +2,13 @@ + # Microsoft Azure Linux Agent Configuration + # + +-# Enable instance creation +-Provisioning.Enabled=y +- + # Enable extension handling. Do not disable this unless you do not need password reset, + # backup, monitoring, or any extension handling whatsoever. + Extensions.Enabled=y + +-# Rely on cloud-init to provision +-Provisioning.UseCloudInit=n ++# Which provisioning agent to use. Supported values are "auto" (default), "waagent", ++# "cloud-init", or "disabled". ++Provisioning.Agent=auto + + # Password authentication for root account will be unavailable. + Provisioning.DeleteRootPassword=n +diff --git a/config/debian/waagent.conf b/config/debian/waagent.conf +index 28e496e..4c1880e 100644 +--- a/config/debian/waagent.conf ++++ b/config/debian/waagent.conf +@@ -2,15 +2,13 @@ + # Microsoft Azure Linux Agent Configuration + # + +-# Enable instance creation +-Provisioning.Enabled=y +- + # Enable extension handling. Do not disable this unless you do not need password reset, + # backup, monitoring, or any extension handling whatsoever. + Extensions.Enabled=y + +-# Rely on cloud-init to provision +-Provisioning.UseCloudInit=n ++# Which provisioning agent to use. Supported values are "auto" (default), "waagent", ++# "cloud-init", or "disabled". ++Provisioning.Agent=auto + + # Password authentication for root account will be unavailable. + Provisioning.DeleteRootPassword=y +diff --git a/config/freebsd/waagent.conf b/config/freebsd/waagent.conf +index 83988ae..1d1710b 100644 +--- a/config/freebsd/waagent.conf ++++ b/config/freebsd/waagent.conf +@@ -2,15 +2,13 @@ + # Microsoft Azure Linux Agent Configuration + # + +-# Enable instance creation +-Provisioning.Enabled=y +- + # Enable extension handling. Do not disable this unless you do not need password reset, + # backup, monitoring, or any extension handling whatsoever. + Extensions.Enabled=y + +-# Rely on cloud-init to provision +-Provisioning.UseCloudInit=n ++# Which provisioning agent to use. Supported values are "auto" (default), "waagent", ++# "cloud-init", or "disabled". ++Provisioning.Agent=auto + + # Password authentication for root account will be unavailable. + Provisioning.DeleteRootPassword=y +diff --git a/config/gaia/waagent.conf b/config/gaia/waagent.conf +index 6992ff2..b1dc764 100644 +--- a/config/gaia/waagent.conf ++++ b/config/gaia/waagent.conf +@@ -2,15 +2,13 @@ + # Microsoft Azure Linux Agent Configuration + # + +-# Enable instance creation +-Provisioning.Enabled=y +- + # Enable extension handling. Do not disable this unless you do not need password reset, + # backup, monitoring, or any extension handling whatsoever. + Extensions.Enabled=y + +-# Rely on cloud-init to provision +-Provisioning.UseCloudInit=n ++# Which provisioning agent to use. Supported values are "auto" (default), "waagent", ++# "cloud-init", or "disabled". ++Provisioning.Agent=auto + + # Password authentication for root account will be unavailable. + Provisioning.DeleteRootPassword=n +diff --git a/config/iosxe/waagent.conf b/config/iosxe/waagent.conf +index 6787d30..533a234 100644 +--- a/config/iosxe/waagent.conf ++++ b/config/iosxe/waagent.conf +@@ -2,11 +2,9 @@ + # Microsoft Azure Linux Agent Configuration + # + +-# Enable instance creation +-Provisioning.Enabled=n +- +-# Rely on cloud-init to provision +-Provisioning.UseCloudInit=n ++# Which provisioning agent to use. Supported values are "auto" (default), "waagent", ++# "cloud-init", or "disabled". ++Provisioning.Agent=auto + + # Password authentication for root account will be unavailable. + Provisioning.DeleteRootPassword=y +diff --git a/config/nsbsd/waagent.conf b/config/nsbsd/waagent.conf +index 178f9a2..b859fd5 100644 +--- a/config/nsbsd/waagent.conf ++++ b/config/nsbsd/waagent.conf +@@ -2,11 +2,9 @@ + # Microsoft Azure Linux Agent Configuration + # + +-# Enable instance creation +-Provisioning.Enabled=y +- +-# Rely on cloud-init to provision +-Provisioning.UseCloudInit=n ++# Which provisioning agent to use. Supported values are "auto" (default), "waagent", ++# "cloud-init", or "disabled". ++Provisioning.Agent=auto + + # Password authentication for root account will be unavailable. + Provisioning.DeleteRootPassword=n +diff --git a/config/openbsd/waagent.conf b/config/openbsd/waagent.conf +index 54f2e11..697f129 100644 +--- a/config/openbsd/waagent.conf ++++ b/config/openbsd/waagent.conf +@@ -2,11 +2,9 @@ + # Microsoft Azure Linux Agent Configuration + # + +-# Enable instance creation +-Provisioning.Enabled=y +- +-# Rely on cloud-init to provision +-Provisioning.UseCloudInit=n ++# Which provisioning agent to use. Supported values are "auto" (default), "waagent", ++# "cloud-init", or "disabled". ++Provisioning.Agent=auto + + # Password authentication for root account will be unavailable. + Provisioning.DeleteRootPassword=y +diff --git a/config/suse/waagent.conf b/config/suse/waagent.conf +index 5e601e6..dc99b12 100644 +--- a/config/suse/waagent.conf ++++ b/config/suse/waagent.conf +@@ -2,15 +2,13 @@ + # Microsoft Azure Linux Agent Configuration + # + +-# Enable instance creation +-Provisioning.Enabled=y +- + # Enable extension handling. Do not disable this unless you do not need password reset, + # backup, monitoring, or any extension handling whatsoever. + Extensions.Enabled=y + +-# Rely on cloud-init to provision +-Provisioning.UseCloudInit=n ++# Which provisioning agent to use. Supported values are "auto" (default), "waagent", ++# "cloud-init", or "disabled". ++Provisioning.Agent=auto + + # Password authentication for root account will be unavailable. + Provisioning.DeleteRootPassword=y +diff --git a/config/ubuntu/waagent.conf b/config/ubuntu/waagent.conf +index 759db70..8c2c512 100644 +--- a/config/ubuntu/waagent.conf ++++ b/config/ubuntu/waagent.conf +@@ -2,15 +2,13 @@ + # Microsoft Azure Linux Agent Configuration + # + +-# Enable instance creation +-Provisioning.Enabled=n +- + # Enable extension handling. Do not disable this unless you do not need password reset, + # backup, monitoring, or any extension handling whatsoever. + Extensions.Enabled=y + +-# Rely on cloud-init to provision +-Provisioning.UseCloudInit=y ++# Which provisioning agent to use. Supported values are "auto" (default), "waagent", ++# "cloud-init", or "disabled". ++Provisioning.Agent=auto + + # Password authentication for root account will be unavailable. + Provisioning.DeleteRootPassword=y +diff --git a/config/waagent.conf b/config/waagent.conf +index 4754029..d12bb79 100644 +--- a/config/waagent.conf ++++ b/config/waagent.conf +@@ -2,15 +2,13 @@ + # Microsoft Azure Linux Agent Configuration + # + +-# Enable instance creation +-Provisioning.Enabled=y +- + # Enable extension handling. Do not disable this unless you do not need password reset, + # backup, monitoring, or any extension handling whatsoever. + Extensions.Enabled=y + +-# Rely on cloud-init to provision +-Provisioning.UseCloudInit=n ++# Which provisioning agent to use. Supported values are "auto" (default), "waagent", ++# "cloud-init", or "disabled". ++Provisioning.Agent=auto + + # Password authentication for root account will be unavailable. + Provisioning.DeleteRootPassword=y +-- +1.8.3.1 + diff --git a/SPECS/WALinuxAgent.spec b/SPECS/WALinuxAgent.spec index 14bed67..d4bbeb1 100644 --- a/SPECS/WALinuxAgent.spec +++ b/SPECS/WALinuxAgent.spec @@ -1,6 +1,6 @@ %define name WALinuxAgent -%define version 2.2.38 -%define unmangled_version 2.2.38 +%define version 2.2.46 +%define unmangled_version 2.2.46 %define release 2 %if 0%{?rhel} < 7 @@ -13,10 +13,10 @@ Summary: Microsoft Azure Linux Agent Name: %{name} Version: %{version} Release: %{release}%{?dist} -Source0: WALinuxAgent-2.2.38.tar.gz +Source0: WALinuxAgent-2.2.46.tar.gz Patch0002: 0002-Remove-FIPS-setting-from-the-default-config.patch -# For bz#1714167 - [Azure][WALA] Cannot find temporary disk device in Gen2 VM -Patch3: wla-Add-support-for-Gen2-VM-resource-disks-1654.patch +# For bz#1822883 - [Azure][RHEL-7]Some parameter changes are not in waagent.conf +Patch3: wla-Update-Provisioning-options-1853.patch License: ASL 2.0 Group: Development/Libraries @@ -125,8 +125,19 @@ fi %{_unitdir}/waagent.service /etc/udev/rules.d/66-azure-storage.rules /etc/udev/rules.d/99-azure-product-uuid.rules +/etc/logrotate.d/waagent-extn.logrotate %changelog +* Wed Jun 03 2020 Miroslav Rezanina - 2.2.46-2 +- wla-Update-Provisioning-options-1853.patch [bz#1822883] +- Resolves: bz#1822883 + ([Azure][RHEL-7]Some parameter changes are not in waagent.conf) + +* Mon Mar 16 2020 Miroslav Rezanina - 2.2.46-1 +- Rebase to 2.2.26 [bz#1794682] +- Resolves: bz#1794682 + ([Azure][RHEL-7]Rebase WALinuxAgent to 2.2.46) + * Wed Feb 19 2020 Miroslav Rezanina - 2.2.38-2.el7 - wla-Add-support-for-Gen2-VM-resource-disks-1654.patch [bz#1714167] - Resolves: bz#1714167