From 35aafe1c03b8c61e6c499c62c8e2bfd58c8067b9 Mon Sep 17 00:00:00 2001 From: Volker Theile Date: Mon, 20 Jan 2025 13:42:54 +0100 Subject: [PATCH] Apply suggestions from code review s Co-authored-by: Jillian <67180770+jillian-maroket@users.noreply.github.com> --- docs/troubleshooting/vm.md | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/docs/troubleshooting/vm.md b/docs/troubleshooting/vm.md index 4dccba0333..6d6c256759 100644 --- a/docs/troubleshooting/vm.md +++ b/docs/troubleshooting/vm.md @@ -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 -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