KVM instances fail at creation with: Failed to get shared "write" lock Is another process using the image?
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Canonical Juju |
Fix Released
|
High
|
Joseph Phillips | ||
libvirt (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
qemu (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Juju version: 2.5.0
Qemu version: qemu-system-x86 2.11+dfsg-
When creating multiple KVM instances using Juju, some fail with "exit status 13".
Looking at the unit-machine logs, I can see what seems to be a race-condition between qemu-img create and virsh start commands:
2019-02-15 16:31:27 DEBUG juju.container.kvm run_linux.go:24 running: qemu-img [create -b /var/lib/
8G]
2019-02-15 16:31:27 DEBUG juju.container.kvm run_linux.go:25 running as uid: 64055, gid: 117
2019-02-15 16:31:27 DEBUG juju.container.kvm run_linux.go:36 output: Formatting '/var/lib/
amd64-backing-
2019-02-15 16:31:27 DEBUG juju.container.kvm wrappedcmds.go:481 create root image: Formatting '/var/lib/
guests/
2019-02-15 16:31:27 DEBUG juju.container.kvm run.go:19 virsh [define /var/lib/
2019-02-15 16:31:27 DEBUG juju.container.kvm run.go:21 output: Domain juju-720d5c-1-kvm-3 defined from /var/lib/
2019-02-15 16:31:27 DEBUG juju.container.kvm wrappedcmds.go:204 created domain: Domain juju-720d5c-1-kvm-3 defined from /var/lib/
2019-02-15 16:31:27 DEBUG juju.container.kvm run.go:19 virsh [start juju-720d5c-
2019-02-15 16:31:29 DEBUG juju.container.kvm run.go:21 output: error: Failed to start domain juju-720d5c-1-kvm-3
error: internal error: qemu unexpectedly closed the monitor: 2019-02-
2019-02-
Is another process using the image?
2019-02-15 16:31:29 ERROR juju.provisione
2019-02-15 16:31:29 WARNING juju.provisioner provisioner_
in 10s (10 more attempts)
It never works (on all 10x trials).
There is a lot of reports on qemu-img's request for write lock although reading infos:
https:/
https:/
https:/
https:/
One solution seems to be passing --force-share to qemu-img command. That may be risky in a scenario where Juju AND other things are using qemu at the same time, as discussed on: https:/
Can we create a new image file for every VM to deploy? Or --force-share is an alternative?
Either way, there seems to be no work-around besides changing Juju at the moment.
summary: |
- KVM containers fail at creation with: Failed to get shared "write" lock + KVM instances fail at creation with: Failed to get shared "write" lock Is another process using the image? |
description: | updated |
description: | updated |
Changed in juju: | |
status: | New → Triaged |
importance: | Undecided → High |
assignee: | nobody → Richard Harding (rharding) |
Changed in juju: | |
status: | Triaged → In Progress |
assignee: | Richard Harding (rharding) → Joseph Phillips (manadart) |
Changed in juju: | |
status: | In Progress → Fix Committed |
Changed in juju: | |
status: | Fix Committed → In Progress |
Changed in juju: | |
status: | In Progress → Fix Committed |
Changed in juju: | |
status: | Fix Committed → Fix Released |
I am setting this bug to field-high as we have two projects that can greatly benefit on this feature.