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

Enabling vcpu cpuset parameter for heterogeneous cpus #1140

Open
2 of 5 tasks
phkrl opened this issue Dec 26, 2024 · 0 comments · May be fixed by #1141
Open
2 of 5 tasks

Enabling vcpu cpuset parameter for heterogeneous cpus #1140

phkrl opened this issue Dec 26, 2024 · 0 comments · May be fixed by #1141

Comments

@phkrl
Copy link

phkrl commented Dec 26, 2024

System Information

Linux distribution

ARMtix

Terraform version

terraform -v

Terraform v1.10.2
on linux_arm64

Provider and libvirt versions

Provider: v0.8.1
Libvirt: 10.10.0


Checklist

  • Is your issue/contribution related with enabling some setting/option exposed by libvirt that the plugin does not yet support, or requires changing/extending the provider terraform schema?

    • Make sure you explain why this option is important to you, why it should be important to everyone. Describe your use-case with detail and provide examples where possible.
    • If it is a very special case, consider using the XSLT support in the provider to tweak the definition instead of opening an issue
    • Maintainers do not have expertise in every libvirt setting, so please, describe the feature and how it is used. Link to the appropriate documentation
  • Is it a bug or something that does not work as expected? Please make sure you fill the version information below:

Description of Issue/Question

An attempt to create libvirt domain on aarch64 device with heterogeneous cpu (4xCortex-A76+4xCortex-A55 cores) results into error message:

qemu-system-aarch64: Failed to put registers after init: Invalid argument

Running bare qemu-system-aarch64 with, e.g. cpu=host, works fine. Also running same configuration on the same system with only 4xCortex-A55 cores works fine too.
As shown in this issue, in order to solve the problem one needs to either disable 4 cores on the host or force libvirt to only use subset of cpus via xml or cpuset arg (the latter is linked). The provider currently does not support cpuset argument for vcpus.
Unfortunately, i am no expert in libvirt myself, thus cannot give any underlying documentation.

Setup

resource "libvirt_domain" "vm" {
  name      = "test"
  vcpu      = 1
  memory    = 412
  running   = true
  autostart = true

  arch     = "aarch64"
  machine  = "virt"
  type     = "kvm"
  firmware = "/usr/share/edk2/aarch64/QEMU_CODE.fd"

  cpu {
    mode = "host-passthrough"
  }
  disk {
    volume_id = "/armtix-worker/libvirt/pools/armtix/test_root"
    scsi      = true
    wwn       = "615392a40ddc3170"
  }

  console {
    type           = "tcp"
    target_port    = "7"
    target_type    = "serial"
    source_service = 20000
  }
}

Steps to Reproduce Issue

The only thing needed to reproduce the issue is a heterogeneous cpu typically found on aarch64 devices.


Additional information:

Do you have SELinux or Apparmor/Firewall enabled? Some special configuration?
Have you tried to reproduce the issue without them enabled?

Disabled; the same setup works on the same system without heterogeneous cpus (4xCortex-A55)

@phkrl phkrl linked a pull request Dec 27, 2024 that will close this issue
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 a pull request may close this issue.

1 participant