From e1c640753361c933dcdefcb19187d4e20dd3b387 Mon Sep 17 00:00:00 2001 From: Eduardo Otubo Date: Wed, 26 Jan 2022 12:31:48 +0100 Subject: [PATCH 1/4] Add _netdev option to mount Azure ephemeral disk The ephemeral disk depends on a functional network to be mounted. Even though it depends on cloud-init.service, sometimes an ordering cycle is noticed on the instance. If the option "_netdev" is added the problem is gone. rhbz: #1998445 Signed-off-by: Eduardo Otubo --- cloudinit/config/cc_mounts.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cloudinit/config/cc_mounts.py b/cloudinit/config/cc_mounts.py index ec2e46ff202..ebbaf2385d7 100644 --- a/cloudinit/config/cc_mounts.py +++ b/cloudinit/config/cc_mounts.py @@ -392,7 +392,8 @@ def handle(_name, cfg, cloud, log, _args): def_mnt_opts = "defaults,nobootwait" uses_systemd = cloud.distro.uses_systemd() if uses_systemd: - def_mnt_opts = "defaults,nofail,x-systemd.requires=cloud-init.service" + def_mnt_opts = ("defaults,nofail,x-systemd.requires=cloud-init.service," + ",_netdev") defvals = [None, None, "auto", def_mnt_opts, "0", "2"] defvals = cfg.get("mount_default_fields", defvals) From cdb003d75d9fda97cb6487b212c2911f4a2e6dfb Mon Sep 17 00:00:00 2001 From: Eduardo Otubo Date: Wed, 26 Jan 2022 13:07:14 +0100 Subject: [PATCH 2/4] Breaking the line earlier so tox won't complain --- cloudinit/config/cc_mounts.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cloudinit/config/cc_mounts.py b/cloudinit/config/cc_mounts.py index ebbaf2385d7..b81e7760c3d 100644 --- a/cloudinit/config/cc_mounts.py +++ b/cloudinit/config/cc_mounts.py @@ -392,8 +392,8 @@ def handle(_name, cfg, cloud, log, _args): def_mnt_opts = "defaults,nobootwait" uses_systemd = cloud.distro.uses_systemd() if uses_systemd: - def_mnt_opts = ("defaults,nofail,x-systemd.requires=cloud-init.service," - ",_netdev") + def_mnt_opts = ("defaults,nofail," + "x-systemd.requires=cloud-init.service,_netdev") defvals = [None, None, "auto", def_mnt_opts, "0", "2"] defvals = cfg.get("mount_default_fields", defvals) From 398e61937dbf6556832ae45d7e5aba9253880614 Mon Sep 17 00:00:00 2001 From: Eduardo Otubo Date: Fri, 4 Feb 2022 13:01:42 +0100 Subject: [PATCH 3/4] Fixing style issues. --- cloudinit/config/cc_mounts.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cloudinit/config/cc_mounts.py b/cloudinit/config/cc_mounts.py index b81e7760c3d..7977a0bb2f2 100644 --- a/cloudinit/config/cc_mounts.py +++ b/cloudinit/config/cc_mounts.py @@ -392,8 +392,9 @@ def handle(_name, cfg, cloud, log, _args): def_mnt_opts = "defaults,nobootwait" uses_systemd = cloud.distro.uses_systemd() if uses_systemd: - def_mnt_opts = ("defaults,nofail," - "x-systemd.requires=cloud-init.service,_netdev") + def_mnt_opts = ( + "defaults,nofail," "x-systemd.requires=cloud-init.service,_netdev" + ) defvals = [None, None, "auto", def_mnt_opts, "0", "2"] defvals = cfg.get("mount_default_fields", defvals) From bc0b5a75864303169e41c4ea49591d234a536d03 Mon Sep 17 00:00:00 2001 From: Eduardo Otubo Date: Fri, 4 Feb 2022 13:19:34 +0100 Subject: [PATCH 4/4] Another style problem fixed --- cloudinit/config/cc_mounts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudinit/config/cc_mounts.py b/cloudinit/config/cc_mounts.py index 7977a0bb2f2..a81ae952867 100644 --- a/cloudinit/config/cc_mounts.py +++ b/cloudinit/config/cc_mounts.py @@ -393,7 +393,7 @@ def handle(_name, cfg, cloud, log, _args): uses_systemd = cloud.distro.uses_systemd() if uses_systemd: def_mnt_opts = ( - "defaults,nofail," "x-systemd.requires=cloud-init.service,_netdev" + "defaults,nofail, x-systemd.requires=cloud-init.service, _netdev" ) defvals = [None, None, "auto", def_mnt_opts, "0", "2"]