hashicorp / hashicorp/nomad-driver-virt

Windows vm fail - virt: failed to build task network: failed to discover IP address: timeout reached discovering DHCP lease for nomad task

Open
#91 0 comments 0 reactions 0 assignees View on GitHub
stage/accepted theme/os/windows type/bug
Dominant language
Go
Stars
32
Forks
9
Avg merge
1d 10h
Merged PRs (30d)
11

Description

This is how I configured my Windows 2022 image. (In addition to this image, most of the other windows vm's failed.)
libvirt and other components followed the configuration on Ubuntu and were not modified. Ubuntu Cloud Images that are not Windows VMs work fine.

https://github.com/ruzickap/packer-templates/tree/main?tab=readme-ov-file

```bash
./build.sh windows-server-2022-standard-x64-eval-libvirt
```

The following errors are checked in the task in the Nomad UI

```
task=virt-task error="rpc error: code = Unknown desc = virt: failed to build task network: failed to discover IP address: timeout reached discovering DHCP lease for \"nomad-virt-task-aee247df\""
```

The journal log will output the following

```
Dec 01 11:12:09 ip-10-10-1-215 networkctl[19932]: Interface "vnet19" not found.
Dec 01 11:12:09 ip-10-10-1-215 systemd[1]: networkd-dispatcher.service: Got notification message from PID 19932, but reception only permitted for main PID 1525
Dec 01 11:12:09 ip-10-10-1-215 networkd-dispatcher[1525]: ERROR:Failed to get interface "vnet19" status: Command '['/usr/bin/networkctl', 'status', '--no-pager', '--no-legend', '--', 'vnet19']' returned non-zero exit status 1.
Dec 01 11:12:09 ip-10-10-1-215 systemd[1]: machine-qemu\x2d20\x2dvirt\x2dtask\x2daee247df.scope: Deactivated successfully.
Dec 01 11:12:09 ip-10-10-1-215 systemd-machined[1536]: Machine qemu-20-virt-task-aee247df terminated.
Dec 01 11:12:10 ip-10-10-1-215 audit[19944]: AVC apparmor="STATUS" operation="profile_remove" profile="unconfined" name="libvirt-477ab66c-25f4-4e58-8b3a-a58338e06fdc" pid=19944 comm="apparmor_parser"
Dec 01 11:12:10 ip-10-10-1-215 kernel: audit: type=1400 audit(1733019130.169:244): apparmor="STATUS" operation="profile_remove" profile="unconfined" name="libvirt-477ab66c-25f4-4e58-8b3a-a58338e06fdc" pid=19944 comm="apparmor_parser"
Dec 01 11:12:10 ip-10-10-1-215 libvirtd[1584]: internal error: child reported (status=125): Unable to get XATTR trusted.libvirt.security.ref_dac on /opt/ubuntu/virt_temp/virt-task-aee247df.iso: No such file or directory
Dec 01 11:12:10 ip-10-10-1-215 libvirtd[1584]: Unable to get XATTR trusted.libvirt.security.ref_dac on /opt/ubuntu/virt_temp/virt-task-aee247df.iso: No such file or directory
Dec 01 11:12:10 ip-10-10-1-215 libvirtd[1584]: Unable to remove disk metadata on vm virt-task-aee247df from /opt/ubuntu/virt_temp/virt-task-aee247df.iso (disk target sda)
Dec 01 11:12:10 ip-10-10-1-215 nomad[1526]: 2024-12-01T11:12:10.179+0900 [INFO] client.alloc_runner.task_runner: Task event: alloc_id=0752a939-4b3b-b515-da17-3f21a127e8f6 task=virt-task type="Driver Failure" msg="rpc error: code = Unknown desc = virt: failed to build task network: failed to discover IP address: timeout reached discovering DHCP lease for \"nomad-virt-task-aee247df\"" failed=false
Dec 01 11:12:10 ip-10-10-1-215 nomad[1526]: 2024-12-01T11:12:10.181+0900 [ERROR] client.alloc_runner.task_runner: running driver failed: alloc_id=0752a939-4b3b-b515-da17-3f21a127e8f6 task=virt-task error="rpc error: code = Unknown desc = virt: failed to build task network: failed to discover IP address: timeout reached discovering DHCP lease for \"nomad-virt-task-aee247df\""
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the Windows Server 2022 libvirt configuration linked in the issue and reproduce it with ./build.sh windows-server-2022-standard-x64-eval-libvirt. Compare the Nomad task error with the journal entries for the missing vnet interface, DHCP lease timeout, and libvirt ISO metadata failure; done means identifying and correcting the cause so the Windows VM task obtains its network lease.

Written by the indexing model from the issue text.

Assessment

Tech stack
ubuntu
Domain
infrastructure, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.