Comment 0 for bug 1919177

Revision history for this message
Gauthier Jolly (gjolly) wrote :

[General]

On Azure, when provisioning a Hirsute VM with Accelerated Networking enabled, sometimes the SSH key is not setup properly and the user cannot log into the VM.

[how to reproduce]

Start a VM with AN enabled:

```
az vm create --name "$VM_NAME --resource-group "$GROUP" --location "UK South" --image 'Canonical:0001-com-ubuntu-server-hirsute-daily:21_04-daily-gen2:latest' --size Standard_F8s_v2 --admin-username ubuntu --ssh-key-value "$SSH_KEY" --accelerated-networking
```

After a moment, try to SSH: if you succeed, delete and recreate a new VM.

[troubleshooting]

To be able to connect into the VM to debug, run:

```
az vm run-command invoke -g "$GROUP" -n "$VM_NAME" --command-id RunShellScript --scripts "sudo -u ubuntu ssh-import-id $LP_USERNAME"
```

In "/run/cloud-init/instance-data.json", I can see:
```
     "publicKeys": [
      {
       "keyData": "<my-pub-key>",
       "path": "/home/ubuntu/.ssh/authorized_keys"
      }
     ],
```

as expected.