# Launch with cloud-config setting bogus passw0rd because we expect to have to use serial console to login
$ cat > set-hostname.yaml <<EOF
## template: jinja
#cloud-config
ssh_import_id: [chad.smith]
hostname: SRU-worked-{{v1.cloud_name}}
password: passw0rd
chpasswd: { expire: False }
ssh_pwauth: True
EOF
# Launch instance with poor default password as we expect network to come up broken
# Run sample script from serial console to capture current broken state
cat oracle-sru-verification.sh
#!/bin/bash
set -ex
echo "===== confirm failure"
dpkg-query --show cloud-init
ip a
ip r
cat /etc/netplan/50-cloud-init.yaml
for file in /run/systemd/network/*; do
cat $file;
done
egrep 'WARNING|Applying' /var/log/cloud-init.log
$ ssh ubuntu@VM_IP # Assume we can now get in (a measure of success)
# Check prior script run in failed config case
+ echo '===== confirm failure'
===== confirm failure
+ dpkg-query --show cloud-init
cloud-init 22.3.3-0ubuntu1~22.10.1
+ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: ens3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9000 qdisc pfifo_fast state UP group default qlen 1000
link/ether 02:00:17:0d:c2:d6 brd ff:ff:ff:ff:ff:ff
altname enp0s3
inet 10.0.0.130/24 brd 10.0.0.255 scope global ens3
valid_lft forever preferred_lft forever
inet6 fe80::17ff:fe0d:c2d6/64 scope link
valid_lft forever preferred_lft forever
+ ip r
10.0.0.0/24 dev ens3 proto kernel scope link src 10.0.0.130
+ cat /etc/netplan/50-cloud-init.yaml
# This file is generated from information provided by the datasource. Changes
# to it will not persist across an instance reboot. To disable cloud-init's
# network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
version: 2
ethernets:
ens3: addresses:
- 10.0.0.130/24
match: macaddress: 02:00:17:0d:c2:d6
mtu: 9000 set-name: ens3
+ for file in /run/systemd/network/*
+ cat /run/systemd/network/10-netplan-ens3.link
[Match]
MACAddress=02:00:17:0d:c2:d6
[Link]
Name=ens3
WakeOnLan=off
MTUBytes=9000
+ for file in /run/systemd/network/*
+ cat /run/systemd/network/10-netplan-ens3.network
[Match]
MACAddress=02:00:17:0d:c2:d6
Name=ens3
[Link]
MTUBytes=9000
[Network]
LinkLocalAddressing=ipv6
Address=10.0.0.130/24
+ egrep 'WARNING|Applying' /var/log/cloud-init.log
2022-10-06 22:36:49,941 - DataSourceOracle.py[WARNING]: Could not obtain network configuration from initramfs. Falling back to IMDS.
2022-10-06 22:36:49,980 - stages.py[INFO]: Applying network configuration from ds bringup=False: {'config': [{'name': 'ens3', 'type': 'physical', 'mac_address': '02:00:17:0d:c2:d6', 'mtu': 9000, 'subnets': [{'type': 'static', 'address': '10.0.0.130/24'}]}], 'version': 1}
2022-10-06 22:37:04,789 - DataSourceOracle.py[WARNING]: Could not obtain network configuration from initramfs. Falling back to IMDS.
2022-10-06 22:37:43,291 - util.py[WARNING]: Failed to run command to import ubuntu SSH ids
2022-10-06 22:37:43,295 - util.py[WARNING]: ssh-import-id failed for: ubuntu ['chad.smith']
2022-10-06 22:37:43,298 - util.py[WARNING]: Running module ssh-import-id (<module 'cloudinit.config.cc_ssh_import_id' from '/usr/lib/python3/dist-packages/cloudinit/config/cc_ssh_import_id.py'>) failed
##### Validate no errors and proper routes/ip/config on 22.3.4
ubuntu@SRU-worked-oracle:~$ cloud-init --version
/usr/bin/cloud-init 22.3.4-0ubuntu1
ubuntu@SRU-worked-oracle:~$ cloud-init status --long --wait
status: done
time: Fri, 07 Oct 2022 02:27:32 +0000
detail:
DataSourceOracle
ubuntu@SRU-worked-oracle:~$ egrep 'Trace|WARN' /var/log/cloud-init.log
2022-10-07 02:27:20,853 - DataSourceOracle.py[WARNING]: Could not obtain network configuration from initramfs. Falling back to IMDS.
2022-10-07 02:27:23,110 - DataSourceOracle.py[WARNING]: Could not obtain network configuration from initramfs. Falling back to IMDS.
ubuntu@SRU-worked-oracle:~$ cat /etc/netplan/50-cloud-init.yaml
# This file is generated from information provided by the datasource. Changes
# to it will not persist across an instance reboot. To disable cloud-init's
# network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
version: 2
ethernets:
ens3:
dhcp4: true
match: macaddress: 02:00:17:0d:c2:d6
mtu: 9000 set-name: ens3
ubuntu@SRU-worked-oracle:~$ ip r
default via 10.0.0.1 dev ens3 proto dhcp src 10.0.0.130 metric 100
10.0.0.0/24 dev ens3 proto kernel scope link src 10.0.0.130 metric 100
10.0.0.1 dev ens3 proto dhcp scope link src 10.0.0.130 metric 100
169.254.169.254 via 10.0.0.1 dev ens3 proto dhcp src 10.0.0.130 metric 100
ubuntu@SRU-worked-oracle:~$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: ens3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9000 qdisc pfifo_fast state UP group default qlen 1000
link/ether 02:00:17:0d:c2:d6 brd ff:ff:ff:ff:ff:ff
altname enp0s3
inet 10.0.0.130/24 metric 100 brd 10.0.0.255 scope global dynamic ens3
valid_lft 86348sec preferred_lft 86348sec
inet6 fe80::17ff:fe0d:c2d6/64 scope link
valid_lft forever preferred_lft forever
##kinetic validation 22.3.4
I was able to validate kinetic failure path 22.3.3 using this procedure below and success across upgrade to 22.3.4:
$ wget https:/ /cloud- images. ubuntu. com/kinetic/ 20220925/ kinetic- server- cloudimg- amd64.img server- cloudimg- amd64.img name="blackboxs w-test- kinetic" --uri https:/ /objectstorage. us-phoenix- 1.oraclecloud. com/n/intcanoni cal/b/blackboxs w-bucket/ o/kinetic- server- cloudimg- amd64.img --compartment- id="ocid1. compartment. oc1..aaaaaaaagy dpgegyncqufyw45 spizdp7t4bxpy75 2csiioelfyyykve dkf4a" --launch- mode="PARAVIRTU ALIZED" --source- image-type= "qcow2"
$ oci os object put -ns intcanonical -bn blackboxsw-bucket --file kinetic-
$ oci compute image import from-object-uri --display-
# Launch with cloud-config setting bogus passw0rd because we expect to have to use serial console to login {{v1.cloud_ name}}
$ cat > set-hostname.yaml <<EOF
## template: jinja
#cloud-config
ssh_import_id: [chad.smith]
hostname: SRU-worked-
password: passw0rd
chpasswd: { expire: False }
ssh_pwauth: True
EOF
# Launch instance with poor default password as we expect network to come up broken
$ oci compute instance launch --availability- domain= "qIZq:PHX- AD-3" --shape= "VM.Standard2. 1" --image- id="ocid1. image.oc1. phx.aaaaaaaazgo 7n42d6zl4ucig4w 5spqnmaexakaqc6 trsukgbxaslynrs vqsq" --subnet- id="ocid1. subnet. oc1.phx. aaaaaaaacosethj trcdct2imjdbrsr uvfhhiaq2xf64d4 klhuy54aflokqaq " --ssh-authorize d-keys- file=". ssh/id_ rsa.pub" --user- data-file= "./sethostname. yaml" -c ocid1.tenancy. oc1..aaaaaaaao7 f7cccogqrg5emjx kxmctzbnhl6zdkk x36yq2jgxnm4p5v mysbq --display-name bbsw-kinetic-dbg
# Run sample script from serial console to capture current broken state sru-verificatio n.sh 50-cloud- init.yaml network/ *; do cloud-init. log
cat oracle-
#!/bin/bash
set -ex
echo "===== confirm failure"
dpkg-query --show cloud-init
ip a
ip r
cat /etc/netplan/
for file in /run/systemd/
cat $file;
done
egrep 'WARNING|Applying' /var/log/
echo "===== fix network manually" net/ens3/ address)
macaddress: $MAC
set- name: ens3 init-dev/ proposed -y 50-cloud- init.yaml
MAC=$(cat /sys/class/
cat > 50-cloud-init.yaml <<EOF
# Temporarily fix netplan setting dhcp on primary NIC
network:
version: 2
ethernets:
ens3:
dhcp4: true
match:
EOF
sudo cp 50-cloud-init.yaml /etc/netplan
sudo netplan generate
sudo netplan apply
echo "===== confirm success across upgrade/reboot"
sudo add-apt-repository ppa:cloud-
sudo apt install cloud-init -y
sudo rm /etc/netplan/
sudo cloud-init clean --logs --reboot
$ ssh ubuntu@VM_IP # Assume we can now get in (a measure of success)
# Check prior script run in failed config case
+ echo '===== confirm failure' 0ubuntu1~ 22.10.1 UP,LOWER_ UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 MULTICAST, UP,LOWER_ UP> mtu 9000 qdisc pfifo_fast state UP group default qlen 1000 fe0d:c2d6/ 64 scope link 50-cloud- init.yaml cloud.cfg. d/99-disable- network- config. cfg with the following:
addresses:
macaddress: 02:00:17:0d:c2:d6
set- name: ens3 network/ * network/ 10-netplan- ens3.link 02:00:17: 0d:c2:d6
===== confirm failure
+ dpkg-query --show cloud-init
cloud-init 22.3.3-
+ ip a
1: lo: <LOOPBACK,
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: ens3: <BROADCAST,
link/ether 02:00:17:0d:c2:d6 brd ff:ff:ff:ff:ff:ff
altname enp0s3
inet 10.0.0.130/24 brd 10.0.0.255 scope global ens3
valid_lft forever preferred_lft forever
inet6 fe80::17ff:
valid_lft forever preferred_lft forever
+ ip r
10.0.0.0/24 dev ens3 proto kernel scope link src 10.0.0.130
+ cat /etc/netplan/
# This file is generated from information provided by the datasource. Changes
# to it will not persist across an instance reboot. To disable cloud-init's
# network configuration capabilities, write a file
# /etc/cloud/
# network: {config: disabled}
network:
version: 2
ethernets:
ens3:
- 10.0.0.130/24
match:
mtu: 9000
+ for file in /run/systemd/
+ cat /run/systemd/
[Match]
MACAddress=
[Link] network/ * network/ 10-netplan- ens3.network 02:00:17: 0d:c2:d6
Name=ens3
WakeOnLan=off
MTUBytes=9000
+ for file in /run/systemd/
+ cat /run/systemd/
[Match]
MACAddress=
Name=ens3
[Link]
MTUBytes=9000
[Network] sing=ipv6 10.0.0. 130/24 cloud-init. log e.py[WARNING] : Could not obtain network configuration from initramfs. Falling back to IMDS. 17:0d:c2: d6', 'mtu': 9000, 'subnets': [{'type': 'static', 'address': '10.0.0. 130/24' }]}], 'version': 1} e.py[WARNING] : Could not obtain network configuration from initramfs. Falling back to IMDS. config. cc_ssh_ import_ id' from '/usr/lib/ python3/ dist-packages/ cloudinit/ config/ cc_ssh_ import_ id.py'> ) failed
LinkLocalAddres
Address=
+ egrep 'WARNING|Applying' /var/log/
2022-10-06 22:36:49,941 - DataSourceOracl
2022-10-06 22:36:49,980 - stages.py[INFO]: Applying network configuration from ds bringup=False: {'config': [{'name': 'ens3', 'type': 'physical', 'mac_address': '02:00:
2022-10-06 22:37:04,789 - DataSourceOracl
2022-10-06 22:37:43,291 - util.py[WARNING]: Failed to run command to import ubuntu SSH ids
2022-10-06 22:37:43,295 - util.py[WARNING]: ssh-import-id failed for: ubuntu ['chad.smith']
2022-10-06 22:37:43,298 - util.py[WARNING]: Running module ssh-import-id (<module 'cloudinit.
##### Validate no errors and proper routes/ip/config on 22.3.4 SRU-worked- oracle: ~$ cloud-init --version SRU-worked- oracle: ~$ cloud-init status --long --wait
ubuntu@
/usr/bin/cloud-init 22.3.4-0ubuntu1
ubuntu@
status: done SRU-worked- oracle: ~$ egrep 'Trace|WARN' /var/log/ cloud-init. log e.py[WARNING] : Could not obtain network configuration from initramfs. Falling back to IMDS. e.py[WARNING] : Could not obtain network configuration from initramfs. Falling back to IMDS. SRU-worked- oracle: ~$ cat /etc/netplan/ 50-cloud- init.yaml cloud.cfg. d/99-disable- network- config. cfg with the following:
macaddress: 02:00:17:0d:c2:d6
set- name: ens3 SRU-worked- oracle: ~$ ip r SRU-worked- oracle: ~$ ip a UP,LOWER_ UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 MULTICAST, UP,LOWER_ UP> mtu 9000 qdisc pfifo_fast state UP group default qlen 1000 fe0d:c2d6/ 64 scope link
time: Fri, 07 Oct 2022 02:27:32 +0000
detail:
DataSourceOracle
ubuntu@
2022-10-07 02:27:20,853 - DataSourceOracl
2022-10-07 02:27:23,110 - DataSourceOracl
ubuntu@
# This file is generated from information provided by the datasource. Changes
# to it will not persist across an instance reboot. To disable cloud-init's
# network configuration capabilities, write a file
# /etc/cloud/
# network: {config: disabled}
network:
version: 2
ethernets:
ens3:
dhcp4: true
match:
mtu: 9000
ubuntu@
default via 10.0.0.1 dev ens3 proto dhcp src 10.0.0.130 metric 100
10.0.0.0/24 dev ens3 proto kernel scope link src 10.0.0.130 metric 100
10.0.0.1 dev ens3 proto dhcp scope link src 10.0.0.130 metric 100
169.254.169.254 via 10.0.0.1 dev ens3 proto dhcp src 10.0.0.130 metric 100
ubuntu@
1: lo: <LOOPBACK,
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: ens3: <BROADCAST,
link/ether 02:00:17:0d:c2:d6 brd ff:ff:ff:ff:ff:ff
altname enp0s3
inet 10.0.0.130/24 metric 100 brd 10.0.0.255 scope global dynamic ens3
valid_lft 86348sec preferred_lft 86348sec
inet6 fe80::17ff:
valid_lft forever preferred_lft forever