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

Use hda instad of Hdd #615

Closed
MalloZup opened this issue Jul 9, 2019 · 10 comments
Closed

Use hda instad of Hdd #615

MalloZup opened this issue Jul 9, 2019 · 10 comments
Assignees

Comments

@MalloZup
Copy link
Collaborator

MalloZup commented Jul 9, 2019

Hello, I've hit a problem described by @enool here:

There is actually a flaw in the cloudinit update operation too. The device target needs to be the same as it was when the domain update is applied. I'll have a look.

I have a bunch of production VMs created with terraform-provider-libvirt version before 0.5.2, after upgrading to 0.5.2 (actually, to master with 0.12 support) I've got lots of messages like this

Error: Error while changing the cloudinit volume: virError(Code=8, Domain=10, Message='invalid argument: target hdd doesn't exist.')

  on ../modules/libvirt/generic-vm/main.tf line 97, in resource "libvirt_domain" "generic-vm":
  97: resource "libvirt_domain" "generic-vm" {

I haven't found a quick and accurate solution for this, so, as a workaround, I've built my own terraform-provider-libvirt version changing hdd to hda in domain.go, but the issue has to be fixed before 0.6.0 release, FYI @MalloZup

Originally posted by @thundertaker in #563 (comment)

@MalloZup
Copy link
Collaborator Author

MalloZup commented Jul 9, 2019

this issue need to be investigated

@MalloZup MalloZup changed the title Use hda instad of HDD Use hda instad of Hdd Jul 9, 2019
@MalloZup
Copy link
Collaborator Author

MalloZup commented Jul 9, 2019

@enool cc

@enool
Copy link
Contributor

enool commented Jul 9, 2019

I'll take a look

@enool
Copy link
Contributor

enool commented Jul 9, 2019

It's an incompatibility between 0.5.1 and 0.5.2

To reproduce,

  1. Terraform apply on 0.5.1
  2. Update plugin to 0.5.2
  3. Modify cloud init resource
  4. Terraform apply to refresh -> resourceLibvirtDomainUpdate()

Cloud init resource is recreated (destroy and then create replacement)

-/+ libvirt_cloudinit_disk.commoninit (new resource required) id: "/pool/commoninit.iso;5d24e269-9825-5341-a716-5884d2dfcad7" => <computed> (forces new resource)

Domain is not (update in-place)

~ libvirt_domain.domain-ubuntu cloudinit: "/pool/commoninit.iso;5d24e269-9825-5341-a716-5884d2dfcad7" => "${libvirt_cloudinit_disk.commoninit.id}" graphics.0.listen_address: "" => "127.0.0.1"

The upgrade goes smoothly if domain gets recreated on apply

Workaround for a running domain with "virsh edit"

VISUAL="sed -i \"s@target dev='hda'@target dev='hdd'@\" " virsh edit domain

@enool
Copy link
Contributor

enool commented Jul 9, 2019

To be clear, if users are upgrading from 0.5.2->0.6.0, this would not be an issue for them.

@MalloZup
Copy link
Collaborator Author

MalloZup commented Jul 9, 2019

@enool many thx for your info and research. 👏

IMHO I dunno personally if we should create some upgrade doc/info.. I mean if it will gone then.. what do you think? Maybe we could add something in the release notes of 6.0 for this. (this sound to me the only usefull doc which we don't need to remove after)

@enool
Copy link
Contributor

enool commented Jul 9, 2019

A mention in release notes sounds good.

@MalloZup
Copy link
Collaborator Author

done thx

@MalloZup
Copy link
Collaborator Author

@thundertaker
Copy link

VISUAL="sed -i \"s@target dev='hda'@target dev='hdd'@\" " virsh edit domain doesn't work without the VM reboot, this is not acceptible in our case

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants