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

Re-running terraform apply after initial Error will error out with "domain [...] already exists" #921

Open
raoulbhatia opened this issue Jan 1, 2022 · 3 comments

Comments

@raoulbhatia
Copy link

Related to #920 and also #423

System Information etc.

See #920


Description of Issue/Question

Setup

See #920

Steps to Reproduce Issue

  1. terraform apply until you hit Automatically configure app-armor for non-standard paths (to work around upstream bug) #920
  2. Manually fix by editing /etc/apparmor.d/local/abstractions/libvirt-qemu
  3. terraform apply
libvirt_domain.domain-ubuntu: Creating...
╷
│ Error: error defining libvirt domain: operation failed: domain 'terraform-kvm-ansible' already exists with uuid 7454585d-3a7c-42a9-a822-835b9ca3c1b6
│
│   with libvirt_domain.domain-ubuntu,
│   on main.tf line 33, in resource "libvirt_domain" "domain-ubuntu":
│   33: resource "libvirt_domain" "domain-ubuntu" {
│

Solution

  1. Run virsh undefine terraform-kvm-ansible
  2. terraform apply
  3. terraform-kvm-ansible will come up successfully

Additional information:

Apparmor as articulated in #920

@alancaldelas
Copy link

This also is happening to me, any updates?

@tovoro
Copy link

tovoro commented Mar 17, 2022

Same here while deploying Centos 8 guests on a Fedora35 Host. Additionally, the domain does not get destroyed when running terraform destroy

@alancaldelas
Copy link

Yeah, I'm also on a F35 host. Additionally, I'm doing a UEFI deployment and running the destroy also removes the /usr/share/edk2/OVMF_VARS.fd file so when I got re-deploy the file is now missing.

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

No branches or pull requests

3 participants