Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add troubleshooting issue when VM does not show an IP #658

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

votdev
Copy link
Member

@votdev votdev commented Oct 28, 2024

Copy link

Name Link
🔨 Latest commit 712dd5e
😎 Deploy Preview https://671f6be16b7e710092588ca9--harvester-preview.netlify.app

@bk201 bk201 requested a review from rrajendran17 October 28, 2024 15:55
@rrajendran17
Copy link

LGTM,Thanks

@rrajendran17
Copy link

@votdev Just a thought, this applies only to linux based VMs and not windows VM as there is no cloud init/qemu-ga in windows VM.Do you think it is worth adding a a point on which VMs this is applicable ?

Copy link
Contributor

@jillian-maroket jillian-maroket left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review done

@@ -414,3 +414,37 @@ Node level operation, node by node:
https://github.com/harvester/harvester/issues/5109

https://github.com/longhorn/longhorn/issues/8009

## VM does not show an IP address
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## 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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

Comment on lines +426 to +428
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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

$ 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**.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

Comment on lines +438 to +440
To solve the problem, you can select the **Install guest agent** checkbox in the VM settings under **Advanced Options**.

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
To solve the problem, you can select the **Install guest agent** checkbox in the VM settings under **Advanced Options**.
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
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**.
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.

$ 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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants