You can support us by downloading this article as PDF from the Link below. Download the guide as PDF

Have you ever receive error message like below while working with Openstack and KVM?. If so, a fix is given here.

Command: env LC_ALL=C LANG=C qemu-img info /var/lib/libvirt/images/asterisk.qcow2
Exit code: 1
Stdout: u”
Stderr: u”qemu-img: Could not open ‘/var/lib/libvirt/images/asterisk.qcow2’: Could not open ‘/var/lib/libvirt/images/asterisk.qcow2’: Permission deniedn”

INFO nova.compute.resource_tracker [req-7f9e4964-52c0-4204-ae00-b74fb83acb9c – – – – -] Auditing locally available compute resources for node localhost.localdomain
 ERROR nova.compute.manager [req-7f9e4964-52c0-4204-ae00-b74fb83acb9c РРРР-] Error updating resources for node localhost.localdomain: Unexpected error while running command.
This is a qemu error,in the sense that nova does not have permissions to write/read to the specified qcow2 file.
Stop the libvirtd service

[pastacode lang=”bash” message=”” highlight=”” provider=”manual” manual=”%5Broot%40localhost%20~(keystone)%5D%23%20systemctl%20stop%20libvirtd.service%20%0A”/]

Then set user and group to nova service
Set the dynamic_ownership to zero

[pastacode lang=”bash” message=”” highlight=”” provider=”manual” manual=”%5Broot%40localhost%20~(keystone)%5D%23%20vim%20%C2%A0%2Fetc%2Flibvirt%2Fqemu.conf%0A”/]

[pastacode lang=”bash” message=”” highlight=”” provider=”manual” manual=”%C2%A0user%20%3D%20%22nova%22%0A”/]

# The group for QEMU processes run by the system instance. It can be
# specified in a similar way to user.

[pastacode lang=”bash” message=”” highlight=”” provider=”manual” manual=”group%20%3D%20%22nova%22″/]

# Whether libvirt should dynamically change file ownership
# to match the configured user/group above. Defaults to 1.
# Set to 0 to disable file ownership changes.

[pastacode lang=”bash” message=”” highlight=”” provider=”manual” manual=”dynamic_ownership%20%3D%200%0A”/]

Save the file and restart libvirtd service

[pastacode lang=”bash” message=”” highlight=”” provider=”manual” manual=”%5Broot%40localhost%20~(keystone)%5D%23%20systemctl%20start%20libvirtd.service%0A”/]

and you will be good

 

You can support us by downloading this article as PDF from the Link below. Download the guide as PDF