-
Notifications
You must be signed in to change notification settings - Fork 458
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
Qemu VM failed to start with ignition configured #142
Comments
Is this still an issue? I cannot reproduce this issue on openSUSE Tumbleweed with libvirt 3.5.0. There's coreos/bugs#2083 which might be related. |
Closing this due to no response. Feel free to reopen the issue if needed. |
I think this is a SELinux issue. For example: $ cat main.tf
provider "libvirt" {
uri = "qemu:///system"
}
data "ignition_systemd_unit" "example" {
name = "example.service"
content = "[Service]\nType=oneshot\nExecStart=/usr/bin/echo Hello World\n\n[Install]\nWantedBy=multi-user.target"
}
data "ignition_config" "etcd" {
systemd = [
"${data.ignition_systemd_unit.example.id}",
]
}
resource "libvirt_ignition" "etcd" {
name = "etcd.ign"
content = "${data.ignition_config.etcd.rendered}"
}
resource "libvirt_volume" "base" {
name = "base"
source = "file:///tmp/coreos_production_qemu_image.img"
}
resource "libvirt_volume" "etcd" {
name = "etcd"
base_volume_id = "${libvirt_volume.base.id}"
}
resource "libvirt_domain" "etcd" {
name = "etcd"
memory = "1024"
coreos_ignition = "${libvirt_ignition.etcd.id}"
disk {
volume_id = "${libvirt_volume.etcd.id}"
}
}
$ sestatus
SELinux status: enabled
SELinuxfs mount: /sys/fs/selinux
SELinux root directory: /etc/selinux
Loaded policy name: targeted
Current mode: enforcing
Mode from config file: enforcing
Policy MLS status: enabled
Policy deny_unknown status: allowed
Max kernel policy version: 31
$ terraform init
$ terraform apply
...
libvirt_ignition.etcd: Creation complete after 1s (ID: /home/trking/VirtualMachines/etcd.ign;5b5f96c6-c821-3584-1a25-5c544a2b87b3)
libvirt_volume.etcd: Creation complete after 1s (ID: /home/trking/VirtualMachines/etcd)
libvirt_domain.etcd: Creating...
arch: "" => "<computed>"
coreos_ignition: "" => "/home/trking/VirtualMachines/etcd.ign;5b5f96c6-c821-3584-1a25-5c544a2b87b3"
disk.#: "" => "1"
disk.0.scsi: "" => "false"
disk.0.volume_id: "" => "/home/trking/VirtualMachines/etcd"
emulator: "" => "<computed>"
machine: "" => "<computed>"
memory: "" => "1024"
name: "" => "etcd"
running: "" => "true"
vcpu: "" => "1"
Error: Error applying plan:
1 error(s) occurred:
* libvirt_domain.etcd: 1 error(s) occurred:
* libvirt_domain.etcd: Error creating libvirt domain: virError(Code=1, Domain=10, Message='internal error: process exited while connecting to monitor: 2018-07-30T22:52:54.865806Z qemu-kvm: -fw_cfg name=opt/com.coreos/config,file=/home/trking/VirtualMachines/etcd.ign: can't load /home/trking/VirtualMachines/etcd.ign')
...
$ ls -lZ ~/VirtualMachines
-rw-r--r--. qemu qemu system_u:object_r:virt_content_t:s0 base
-rw-r--r--. root root system_u:object_r:virt_image_t:s0 etcd
-rw-r--r--. root root system_u:object_r:virt_image_t:s0 etcd.ign
$ terraform destroy
$ sudo setenforce 0
$ terraform apply
...
Apply complete! Resources: 4 added, 0 changed, 0 destroyed. Details on the violation (from
This is with terraform-provider-libvirt built from d29a7cc. |
I personally have |
I also faced this issue, with v0.5.1 version on CentOS 7.6.
after setting SELinux mode to permissive, it worked. For reference,
|
Version Reports:
Distro version of host:
Ubuntu 16.04/16.10/17.04
Terraform Version Report
v0.10
Libvirt version
2.1.0
terraform-provider-libvirt plugin version (git-hash)
8b8c66e
Description of Issue/Question
Qemu failed to start with ignition configured.
Error log:
Error applying plan:
1 error(s) occurred:
libvirt_domain.coreos: 1 error(s) occurred:
libvirt_domain.coreos: Error creating libvirt domain: virError(Code=1, Domain=10, Message='internal error: process exited while connecting to monitor: warning: host doesn't support requested feature: CP
UID.80000001H:ECX.svm [bit 2]
2017-06-28T18:56:40.509521Z qemu-system-x86_64: -fw_cfg name=opt/com.coreos/config,file=/var/lib/libvirt/images/cluster.ign: can't load /var/lib/libvirt/images/cluster.ign')
Setup
tf file (in txt mode) is attached
libvirt.tf.txt
Steps to Reproduce Issue
terraform init
terraform plan
terraform apply
The text was updated successfully, but these errors were encountered: