Ask Your Question
0

Nova VM instances files change ownership to root after live migration

asked 2014-06-12 03:05:49 -0600

alvise gravatar image

updated 2014-06-12 03:06:44 -0600

Hi, I've 3 compute nodes with a shared Gluster filesystem mounted on /var/lib/nova/instances on all 3 nodes. After I start a VM I see the usual files in the shared file system:

[root@compute ~]# ll /var/lib/nova/instances/
total 7
drwxr-xr-x 2 nova nova   75 Jun 12 09:40 4f4ed899-a485-401e-aae7-8029068a6be8
drwxr-xr-x 2 nova nova  106 Jun 12 09:40 _base
drwxr-xr-x 2 nova nova 4102 Jun 12 09:40 locks
[root@compute ~]# ll /var/lib/nova/instances/4f4ed899-a485-401e-aae7-8029068a6be8/
total 4180
-rw-rw---- 1 nova kvm    17219 Jun 12 09:40 console.log
-rw-r--r-- 1 qemu kvm  4259840 Jun 12 09:41 disk
-rw-r--r-- 1 nova nova      79 Jun 12 09:40 disk.info
-rw-r--r-- 1 nova nova    1697 Jun 12 09:40 libvirt.xml

with correct ownerships. Then, I try a live-migration, which apparently goes well:

[root@controller-01 ~]# nova list
+--------------------------------------+------+--------+------------+-------------+----------------+
| ID                                   | Name | Status | Task State | Power State | Networks       |
+--------------------------------------+------+--------+------------+-------------+----------------+
| 4f4ed899-a485-401e-aae7-8029068a6be8 | test | ACTIVE | -          | Running     | admin=10.0.1.4 |
+--------------------------------------+------+--------+------------+-------------+----------------+
[root@controller-01 ~]# nova show test|grep host
| OS-EXT-SRV-ATTR:host                 | compute.cloud.pd.infn.it                                 |
| OS-EXT-SRV-ATTR:hypervisor_hostname  | compute.cloud.pd.infn.it                                 |
| hostId                               | aacf08e590c7dbfebc1c211dd94fb29ea89b002b2422fdcdb7564d59 |
[root@controller-01 ~]# nova live-migration test compute-02.cloud.pd.infn.it
[...]
[root@controller-01 ~]# nova show test|grep host
| OS-EXT-SRV-ATTR:host                 | compute-02.cloud.pd.infn.it                              |
| OS-EXT-SRV-ATTR:hypervisor_hostname  | compute-02.cloud.pd.infn.it                              |
| hostId                               | ae17651af3bd9379b458b1756e08799c22a83c564255297ce2454843 |

But, after migration the ownership of some files has changed:

[root@compute ~]# ll /var/lib/nova/instances/4f4ed899-a485-401e-aae7-8029068a6be8/
total 4165
-rw-rw---- 1 root root    2221 Jun 12 10:03 console.log
-rw-r--r-- 1 root root 4259840 Jun 12 09:41 disk
-rw-r--r-- 1 nova nova      79 Jun 12 09:40 disk.info
-rw-r--r-- 1 nova nova    1697 Jun 12 10:03 libvirt.xml

and the VM is now in read-only mode.

Could you please help me in debugging this ?

thanks,

Alvise

edit retag flag offensive close merge delete

Comments

are you using kvm?

SGPJ gravatar imageSGPJ ( 2014-06-12 14:53:25 -0600 )edit

sure, I'm using it.

alvise gravatar imagealvise ( 2014-06-12 15:15:41 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2014-06-25 02:01:17 -0600

alvise gravatar image

Found the solution: disable dynamic_ownership and change the user/group in qemu.conf:

cat << EOF >> /etc/libvirt/qemu.conf 
user="nova"
group="nova"
dynamic_ownership = 0
EOF

This has worked for me.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2014-06-12 03:05:49 -0600

Seen: 1,024 times

Last updated: Jun 25 '14