Job to deploy qemu VM keep failing

Hi All,

I l struggling with a job which deploy a single Vms on a qemu host.
without any specificity, just creta ea VM.

Here the job spec:

job "vmtest_simple" {
  datacenters = ["test"]
  type        = "service"

  group "group_test" {
    count = 1
    network {
#      mode="bridge" 
        port "ssh" { }

  task "task_test" {
    driver = "qemu"

    config {
      image_path        = "images/debian11.qcow2"
      accelerator       = "kvm"
      graceful_shutdown = true
      args              = ["-nodefaults", "-nodefconfig"]
    resources {
      memory = "1024"

when i check during the job execution the process on the client srevr, the vm creation is created and stop.

The only debug information i got from the nomad server is this :

root@nomad-test:~# nomad alloc status 317d9adc
ID                     = 317d9adc-2f45-59ff-cb0c-e1b7095c29df
Eval ID                = 080c5487
Name                   = vmtest_simple.group_test[0]
Node ID                = cb81b7b0
Node Name              = qemu-nomad-client
Job ID                 = vmtest_simple
Job Version            = 0
Client Status          = failed
Client Description     = Failed tasks
Desired Status         = run
Desired Description    = <none>
Created                = 54s ago
Modified               = 19s ago
Deployment ID          = ef5ed099
Deployment Health      = unhealthy
Reschedule Eligibility = 10s from now

Allocation Addresses:
Label  Dynamic  Address
*ssh   yes

Task "task_test" is "dead"
Task Resources:
CPU        Memory          Disk     Addresses
0/100 MHz  58 MiB/1.0 GiB  300 MiB  

Task Events:
Started At     = 2023-11-02T22:37:48Z
Finished At    = 2023-11-02T22:37:48Z
Total Restarts = 2
Last Restart   = 2023-11-02T18:37:31-04:00

Recent Events:
Time                       Type            Description
2023-11-02T23:37:48+01:00  Not Restarting  Exceeded allowed attempts 2 in interval 30m0s and mode is "fail"
2023-11-02T23:37:48+01:00  Terminated      Exit Code: 1
2023-11-02T23:37:48+01:00  Started         Task started by client
2023-11-02T23:37:31+01:00  Restarting      Task restarting in 16.697207885s
2023-11-02T23:37:31+01:00  Terminated      Exit Code: 1
2023-11-02T23:37:31+01:00  Started         Task started by client
2023-11-02T23:37:14+01:00  Restarting      Task restarting in 17.177297438s
2023-11-02T23:37:14+01:00  Terminated      Exit Code: 1
2023-11-02T23:37:14+01:00  Started         Task started by client
2023-11-02T23:37:14+01:00  Task Setup      Building Task Directory

There are no more log from client side.
I checked examples from with the same result.

When i ran qemu vm creation manually from my client its okay.

Any clue about what could be wrong with my job ?


Hi @NutZ57,

Do the allocation logs have any indication what is happening? These can be seen using the command nomad alloc logs <allocID>.

jrasell and the Nomad team


Finally it was just an issue with the image.
But i have few questions:

  • do we need to downloads the image before to deploy ?
    Because, when i download the image upfronts and put the path of the image in my conf job thats not working.

  • Do we have to use qemu arg to create port mapping ?
    As i understand port mapping for qemu driver is still not available, a PR has been created but not merged →