question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bug: kvm multi host plan fails

See original GitHub issue

Problem

kcli cannot create VMs, via a plan, spread across multiple physical hosts

Scenario

I have 3 kvm/libvirt nodes with the following plan:

---
parameters:
  image: ubuntu2204
  disk_size: 20

dev-cp-1:
  client: lab-01
  profile: large
  image: {{ image }}
  reservehost: false
  disks:
  - size: {{ disk_size }}
  nets: [ br10 ]
dev-cp-2:
  client: lab-02
  profile: large
  image: {{ image }}
  reservehost: false
  disks:
  - size: {{ disk_size }}
  nets: [ br10 ]
dev-cp-3:
  client: lab-03
  profile: large
  image: {{ image }}
  reservehost: false
  disks:
  - size: {{ disk_size }}
  nets: [ br10 ]

Observations

  1. When I run kcli create plan -f ~/.kcli/plans/k3s-dev1.yml k3s-dev the first VM is created on the correct kvm node however kcli reports
lunix@lumbergh]  (main) -> kcli create plan -f ~/.kcli/plans/k3s-dev1.yml k3s-dev
Deploying Vms...
Hypervisor not compatible with nesting. Skipping
Waiting for vm dev-cp-1 to finish customisation
VM dev-cp-1 not found

If I look on lab-01 the vm does exist.

Reading https://github.com/karmab/kcli/blob/master/kvirt/config.py#L2427 and I think perhaps the wait_finish method is connecting to my default ‘client’(kvm host) and not the appropriate one specified in the plan.

  1. If I change the plan so that each node has client: lab-01 and run kcli -C lab-01 create plan -f ~/.kcli/plans/k3s-dev1.yml k3s-dev then the plan completes.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
karmabcommented, Oct 24, 2022

to use kube workflows with multihosts, you will need to leverage the vmrules functionality that allows you to overwrite attributes of vms at deployment time, matching them by their names (either through globbing or regex).

For instance, you would use the following in your parameter file

vmrules:
- dev-cp-1:
    client: lab-01
- dev-cp-2:
    client: lab-02
- dev-cp-3:
    client: lab-03

Actually, you can use this paramfile with your plan and remove the client lines you currently have and you will have the same behaviour

0reactions
aussielunixcommented, Oct 24, 2022

fd49454 should fix it (and also allow the “builtin” kube to actually work as expected accross multiple clients)

Thanks @karmab. I was able to run kcli create plan -f ~/.kcli/plans/k3s-dev1.yml k3s-dev and it completed just fine now.

lunix@lumbergh]  (main) -> kcli -C all get plans
+---------+--------+----------+
|   Plan  |  Host  |   Vms    |
+---------+--------+----------+
| k3s-dev | lab-01 | dev-cp-1 |
| k3s-dev | lab-02 | dev-cp-2 |
| k3s-dev | lab-03 | dev-cp-3 |
+---------+--------+----------+

I haven’t tested using the built in kube creation because I am not sure how to do multi-host with that.

Read more comments on GitHub >

github_iconTop Results From Across the Web

1004167 – KVM fails with "KVM internal error. Suberror: 2"
This bug is being closed with INSUFFICIENT_DATA as there has not been a response in 2 weeks. If you are still experiencing this...
Read more >
KVM live migration fails but VM migrates · Issue #4695
we can observe strange errors when KVM virtual machine live-migration fails with error exit code, but VM itself actually migrates to another  ......
Read more >
5 Known Issues
If the installation fails on the setup due to network issues causing the KVM host to go into a NonResponsive status on the...
Read more >
Bug #1651248 “Ubuntu16.10-KVM:Big configuration with ...
Bug Description · 1) In this configuration, Carol installed patch driver on KVM host to avoid the BUG_ON. · 2) To avoid missing...
Read more >
KVM start failed (ubuntu image) - virtualization
Please, show virsh list --all . · To stop used virsh shutdown vm1 and it was created using virsh create vm1. · Are...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found