Skip to content

Commit 5fcc4ce

Browse files
committed
DLPX-67281 Network configuration not migrated because of multiple netplan files
The root-cause of this issue is that the service that generates the default netplan file for cloud-init (named cloud-init-local) can run at the same time as delphix-migration which writes our own custom netplan file on-disk (and potentially deletes the default one if the timing is right). Unfortunately, timing is not always right and due to the above raace between the two services we end up with two netplan files that can have conflicting info. This change ensures that the migration service runs after cloud-init-local so the default netplan file is always generated before ouyr custom one takes its place. Note again that this is a migration-only issue that can happen on first boot. We disable the cloud-init-local service from regenerating its netplan file for subsequent boots.
1 parent 26281af commit 5fcc4ce

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

files/common/lib/systemd/system/delphix-migration.service

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,22 @@
3737
# local-fs.target, it is better to be more explicit in case we decided to
3838
# remove the latter.
3939
#
40+
# The OS network migration code, even though it doesn't list the
41+
# netplan file generated by cloud-init as a hard dependency, it can
42+
# experience a race as the one pointed in DLPX-67281, where the
43+
# cloud-init-local service runs around the same time and generates
44+
# the default netplan file while we write our custom one on-disk
45+
# through the netconf-migrator. This is bad because we end up with two
46+
# netplan files that can have conflicting information for networkd.
47+
# To avoid this scenario, we make sure that this service runs AFTER
48+
# cloud-init-local.
49+
#
4050
[Unit]
4151
Description=Delphix OS Migration Service
4252
PartOf=delphix.target
4353
DefaultDependencies=no
4454
After=systemd-udev-settle.service
55+
After=cloud-init-local.service
4556
After=var-delphix.mount
4657
After=local-fs.target
4758
Before=network-pre.target

0 commit comments

Comments
 (0)