|
13 | 13 | # limitations under the License. |
14 | 14 |
|
15 | 15 | --- |
16 | | -- name: Wait until all network interfaces are online |
| 16 | +- name: Wait until all network interfaces are online for A3/A4 variants |
17 | 17 | hosts: all |
18 | 18 | become: true |
19 | 19 | tasks: |
|
32 | 32 | Before=google-startup-scripts.service |
33 | 33 |
|
34 | 34 | [Service] |
35 | | - ExecCondition=/bin/bash -c '/usr/bin/curl -s -H "Metadata-Flavor: Google" http://metadata.google.internal/computeMetata/v1/instance/machine-type | grep -q "/a3-highgpu-8g$"' |
| 35 | + # Condition to only run on A3 High machines |
| 36 | + ExecCondition=/bin/bash -c '/usr/bin/curl -s -H "Metadata-Flavor: Google" http://metadata.google.internal/computeMetadata/v1/instance/machine-type | grep -q "/a3-highgpu-8g$"' |
36 | 37 | ExecStart=/usr/lib/systemd/systemd-networkd-wait-online -i enp0s12 -i enp6s0 -i enp12s0 -i enp134s0 -i enp140s0 -o routable --timeout=180 |
37 | 38 | ExecStartPost=/bin/sleep 30 |
38 | 39 |
|
39 | 40 | [Install] |
40 | 41 | WantedBy=multi-user.target |
41 | 42 | notify: |
42 | 43 | - Reload SystemD |
43 | | - - Enable A3 High delay |
| 44 | + |
| 45 | + - name: Create SystemD service for A3 Mega networking |
| 46 | + when: ansible_os_family == "Debian" |
| 47 | + ansible.builtin.copy: |
| 48 | + dest: /etc/systemd/system/delay-a3-mega.service |
| 49 | + owner: root |
| 50 | + group: root |
| 51 | + mode: "0644" |
| 52 | + content: | |
| 53 | + [Unit] |
| 54 | + Description=Delay A3 Mega boot until all network interfaces are routable |
| 55 | + After=network-online.target |
| 56 | + Wants=network-online.target |
| 57 | + Before=google-startup-scripts.service |
| 58 | +
|
| 59 | + [Service] |
| 60 | + # Condition to only run on A3 Mega machines |
| 61 | + ExecCondition=/bin/bash -c '/usr/bin/curl -s -H "Metadata-Flavor: Google" http://metadata.google.internal/computeMetadata/v1/instance/machine-type | grep -q "/a3-megagpu-8g$"' |
| 62 | + ExecStart=/usr/lib/systemd/systemd-networkd-wait-online -i enp0s12 -i enp6s0f0 -i enp7s0f0 -i enp13s0f0 -i enp14s0f0 -i enp134s0f0 -i enp135s0f0 -i enp141s0f0 -i enp142s0f0 -o routable --timeout=180 |
| 63 | + ExecStartPost=/bin/sleep 30 |
| 64 | +
|
| 65 | + [Install] |
| 66 | + WantedBy=multi-user.target |
| 67 | + notify: |
| 68 | + - Reload SystemD |
| 69 | + |
| 70 | + - name: Create SystemD service for A3 Ultra networking |
| 71 | + when: ansible_os_family == "Debian" |
| 72 | + ansible.builtin.copy: |
| 73 | + dest: /etc/systemd/system/delay-a3-ultra.service |
| 74 | + owner: root |
| 75 | + group: root |
| 76 | + mode: "0644" |
| 77 | + content: | |
| 78 | + [Unit] |
| 79 | + Description=Delay A3 Ultra boot until all network interfaces are routable |
| 80 | + After=network-online.target |
| 81 | + Wants=network-online.target |
| 82 | + Before=google-startup-scripts.service |
| 83 | +
|
| 84 | + [Service] |
| 85 | + # Condition to only run on A3 Ultra machines |
| 86 | + ExecCondition=/bin/bash -c '/usr/bin/curl -s -H "Metadata-Flavor: Google" http://metadata.google.internal/computeMetadata/v1/instance/machine-type | grep -q "/a3-ultragpu-8g$"' |
| 87 | + ExecStart=/usr/lib/systemd/systemd-networkd-wait-online -i enp0s19 -i enp192s20 -i gpu0rdma0 -i gpu1rdma0 - gpu2rdma0 -i gpu3rdma0 -i gpu4rdma0 -i gpu5rdma0 -i gpu6rdma0 -i gpu7rdma0 -o routable --timeout=180 |
| 88 | + ExecStartPost=/bin/sleep 30 |
| 89 | +
|
| 90 | + [Install] |
| 91 | + WantedBy=multi-user.target |
| 92 | + notify: |
| 93 | + - Reload SystemD |
| 94 | + |
| 95 | + - name: Create SystemD service for A4 High networking |
| 96 | + when: ansible_os_family == "Debian" |
| 97 | + ansible.builtin.copy: |
| 98 | + dest: /etc/systemd/system/delay-a4-high.service |
| 99 | + owner: root |
| 100 | + group: root |
| 101 | + mode: "0644" |
| 102 | + content: | |
| 103 | + [Unit] |
| 104 | + Description=Delay A4 High boot until all network interfaces are routable |
| 105 | + After=network-online.target |
| 106 | + Wants=network-online.target |
| 107 | + Before=google-startup-scripts.service |
| 108 | +
|
| 109 | + [Service] |
| 110 | + # Condition to only run on A4 High machines |
| 111 | + ExecCondition=/bin/bash -c '/usr/bin/curl -s -H "Metadata-Flavor: Google" http://metadata.google.internal/computeMetadata/v1/instance/machine-type | grep -q "/a4-highgpu-8g$"' |
| 112 | + ExecStart=/usr/lib/systemd/systemd-networkd-wait-online -i enp0s19 -i enp192s20 -i gpu0rdma0 -i gpu1rdma0 - gpu2rdma0 -i gpu3rdma0 -i gpu4rdma0 -i gpu5rdma0 -i gpu6rdma0 -i gpu7rdma0 -o routable --timeout=180 |
| 113 | + ExecStartPost=/bin/sleep 30 |
| 114 | + # To debug interface names on an A4 instance, run: ip link show |
| 115 | +
|
| 116 | + [Install] |
| 117 | + WantedBy=multi-user.target |
| 118 | + notify: |
| 119 | + - Reload SystemD |
| 120 | + |
| 121 | + - name: Enable A3/A4 delay services |
| 122 | + when: ansible_os_family == "Debian" |
| 123 | + ansible.builtin.systemd_service: |
| 124 | + name: "{{ item }}" |
| 125 | + enabled: true |
| 126 | + loop: |
| 127 | + - delay-a3-high.service |
| 128 | + - delay-a3-mega.service |
| 129 | + - delay-a3-ultra.service |
| 130 | + - delay-a4-high.service |
| 131 | + |
44 | 132 | handlers: |
45 | 133 | - name: Reload SystemD |
46 | 134 | ansible.builtin.systemd: |
47 | 135 | daemon_reload: true |
48 | | - post_tasks: |
49 | | - - name: Enable A3 High delay |
50 | | - # by the time this startup-script executes, we don't care if it's started |
51 | | - # just enabled |
52 | | - ansible.builtin.systemd_service: |
53 | | - name: delay-a3-high |
54 | | - enabled: true |
|
0 commit comments