Validated UPPERCASE macs do not cause warnings on xenial and zesty
--- Xenial csmith@fringe:~$ lxc exec test-xenial bash root@test-xenial:~# grep CODENAME /etc/lsb-release; dpkg-query --show cloud-init DISTRIB_CODENAME=xenial cloud-init 0.7.9-233-ge586fe35-0ubuntu1~16.04.1 root@test-xenial:~# read lower < /sys/class/net/eth0/address root@test-xenial:~# echo $lower 00:16:3e:1e:df:cc root@test-xenial:~# upper=$(echo "$lower" | tr '[a-z]' '[A-Z]') root@test-xenial:~# sed -i.dist -e 's,\( *\)name: eth0,\1name: nic0\n\1mac_address: "'$upper'",' \ > /var/lib/cloud/seed/nocloud-net/network-config root@test-xenial:~# ( cd /var/lib/cloud/seed/nocloud-net/ && diff -u network-config.dist network-config ) --- network-config.dist 2017-08-28 17:49:04.566339355 +0000 +++ network-config 2017-08-28 21:36:30.007994177 +0000 @@ -1,7 +1,8 @@ version: 1 config: - type: physical - name: eth0 + name: nic0 + mac_address: "00:16:3E:1E:DF:CC" subnets: - type: dhcp control: auto root@test-xenial:~# ( cd /var/lib/cloud && for i in *; do [ "$i" = "seed" ] || rm -Rf $i; done ) root@test-xenial:~# rm -Rf /var/log/cloud-init* root@test-xenial:~# reboot csmith@fringe:~$ lxc exec test-xenial -- grep WARN /var/log/cloud-init.log || echo "no warnings" no warnings
---- test zesty csmith@fringe:~$ lxc exec test-zesty bash root@test-zesty:~# grep CODENAME /etc/lsb-release; dpkg-query --show cloud-init DISTRIB_CODENAME=zesty cloud-init 0.7.9-233-ge586fe35-0ubuntu1~17.04.1 root@test-zesty:~# read lower < /sys/class/net/eth0/address root@test-zesty:~# echo $lower 00:16:3e:b0:72:1f root@test-zesty:~# upper=$(echo "$lower" | tr '[a-z]' '[A-Z]') root@test-zesty:~# sed -i.dist -e 's,\( *\)name: eth0,\1name: nic0\n\1mac_address: "'$upper'",' \ > /var/lib/cloud/seed/nocloud-net/network-config root@test-zesty:~# ( cd /var/lib/cloud/seed/nocloud-net/ && diff -u network-config.dist network-config ) --- network-config.dist 2017-08-28 17:50:39.302871814 +0000 +++ network-config 2017-08-28 21:41:24.999348297 +0000 @@ -1,7 +1,8 @@ version: 1 config: - type: physical - name: eth0 + name: nic0 + mac_address: "00:16:3E:B0:72:1F" subnets: - type: dhcp control: auto root@test-zesty:~# ( cd /var/lib/cloud && for i in *; do [ "$i" = "seed" ] || rm -Rf $i; done ) root@test-zesty:~# rm -Rf /var/log/cloud-init* root@test-zesty:~# reboot csmith@fringe:~$ lxc exec test-zesty -- grep WARN /var/log/cloud-init.log || echo "no warnings" no warnings
Validated UPPERCASE macs do not cause warnings on xenial and zesty
--- Xenial CODENAME= xenial ge586fe35- 0ubuntu1~ 16.04.1 net/eth0/ address 1mac_address: "'$upper'",' \ cloud/seed/ nocloud- net/network- config cloud/seed/ nocloud- net/ && diff -u network-config.dist network-config )
control: auto cloud-init* cloud-init. log || echo "no warnings"
csmith@fringe:~$ lxc exec test-xenial bash
root@test-xenial:~# grep CODENAME /etc/lsb-release; dpkg-query --show cloud-init
DISTRIB_
cloud-init 0.7.9-233-
root@test-xenial:~# read lower < /sys/class/
root@test-xenial:~# echo $lower
00:16:3e:1e:df:cc
root@test-xenial:~# upper=$(echo "$lower" | tr '[a-z]' '[A-Z]')
root@test-xenial:~# sed -i.dist -e 's,\( *\)name: eth0,\1name: nic0\n\
> /var/lib/
root@test-xenial:~# ( cd /var/lib/
--- network-config.dist 2017-08-28 17:49:04.566339355 +0000
+++ network-config 2017-08-28 21:36:30.007994177 +0000
@@ -1,7 +1,8 @@
version: 1
config:
- type: physical
- name: eth0
+ name: nic0
+ mac_address: "00:16:3E:1E:DF:CC"
subnets:
- type: dhcp
root@test-xenial:~# ( cd /var/lib/cloud && for i in *; do [ "$i" = "seed" ] || rm -Rf $i; done )
root@test-xenial:~# rm -Rf /var/log/
root@test-xenial:~# reboot
csmith@fringe:~$ lxc exec test-xenial -- grep WARN /var/log/
no warnings
---- test zesty CODENAME= zesty ge586fe35- 0ubuntu1~ 17.04.1 net/eth0/ address 1mac_address: "'$upper'",' \ cloud/seed/ nocloud- net/network- config cloud/seed/ nocloud- net/ && diff -u network-config.dist network-config )
control: auto cloud-init* cloud-init. log || echo "no warnings"
csmith@fringe:~$ lxc exec test-zesty bash
root@test-zesty:~# grep CODENAME /etc/lsb-release; dpkg-query --show cloud-init
DISTRIB_
cloud-init 0.7.9-233-
root@test-zesty:~# read lower < /sys/class/
root@test-zesty:~# echo $lower
00:16:3e:b0:72:1f
root@test-zesty:~# upper=$(echo "$lower" | tr '[a-z]' '[A-Z]')
root@test-zesty:~# sed -i.dist -e 's,\( *\)name: eth0,\1name: nic0\n\
> /var/lib/
root@test-zesty:~# ( cd /var/lib/
--- network-config.dist 2017-08-28 17:50:39.302871814 +0000
+++ network-config 2017-08-28 21:41:24.999348297 +0000
@@ -1,7 +1,8 @@
version: 1
config:
- type: physical
- name: eth0
+ name: nic0
+ mac_address: "00:16:3E:B0:72:1F"
subnets:
- type: dhcp
root@test-zesty:~# ( cd /var/lib/cloud && for i in *; do [ "$i" = "seed" ] || rm -Rf $i; done )
root@test-zesty:~# rm -Rf /var/log/
root@test-zesty:~# reboot
csmith@fringe:~$ lxc exec test-zesty -- grep WARN /var/log/
no warnings