Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
s

Co-authored-by: Jillian <[email protected]>
  • Loading branch information
votdev and jillian-maroket authored Jan 20, 2025
1 parent 712dd5e commit 35aafe1
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions docs/troubleshooting/vm.md
Original file line number Diff line number Diff line change
Expand Up @@ -415,35 +415,41 @@ https://github.com/harvester/harvester/issues/5109
https://github.com/longhorn/longhorn/issues/8009
## VM does not show an IP address
## Virtual Machine IP Address Not Displayed
### Issue Description
The VM does not show an IP address on the **Virtual Machines** page on the Harvester UI. This issue might apply to newly created or imported VMs.
The **Virtual Machines** screen on the Harvester UI does not display the IP address of a newly created or imported virtual machine.
### Issue Analysis
If no IP address is displayed for a VM, this is usually because the **qemu-guest-agent** package is not installed in the VM.
You can check this by looking at the status of the **VirtualMachineInstance** object.
This issue usually occurs when the `qemu-guest-agent` package is not installed on the virtual machine. To determine if this is the root cause, check the status of the `VirtualMachineInstance` object.
```shell
$ kubectl get vmi -n <NAMESPACE> <NAME> -ojsonpath='{.status.interfaces[0].infoSource}'
```

If no **qemu-guest-agent** package is installed, then the output will not contain the string **guest-agent**.
The output does not contain the string `guest-agent` when the `qemu-guest-agent` package is not installed.

### Workaround

To solve the problem, you can select the **Install guest agent** checkbox in the VM settings under **Advanced Options**.
You can [install the QEMU guest agent](../vm/create-vm.md#installing-the-qemu-guest-agent) by editing the virtual machine configuration.

1. On the Harvester UI, go to **Virtual Machines**.

1. Locate the affected virtual machine, and then select **⋮ > Edit Config**.

1. On the **Advanced Options** tab, under **Cloud Config**, select **Install guest agent**.

1. Click **Save**.

The problem with this is that cloud-init is only executed once when the VM is started for the first time. To apply the settings specified under **Cloud Configuration** again when the VM is restarted the next time, the cloud-init directory in the VM must be deleted with the command
However, cloud-init is run only once (when the virtual machine is started for the first time). To apply new **Cloud Config** settings, you must delete the cloud-init directory in the virtual machine.

```shell
$ sudo rm -rf /var/lib/cloud/*
```

The VM must then be restarted so that cloud-init is executed again and the **qemu-guest-agent** package is installed.
After deleting the directory, you must restart the virtual machine so that cloud-init is run again and the `qemu-guest-agent` package is installed.

### Related Issue

Expand Down

0 comments on commit 35aafe1

Please sign in to comment.