uid mismatch prevents live migration and nfs share
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
openstack-manuals |
Fix Released
|
Medium
|
Tom Fifield |
Bug Description
Ubuntu documentation for OpenStack install should include uid check between the hosts. It seems ubuntu doesn't use fixed uid numbers for services like nova. This causes nova-compute to fail while using shared nfs storage. That's because nova users have random uid on different hosts, and thus prevent each others to share files under nfs.
NFS4 makes this even bigger problem, since it knows enough to show file owners being nova in all the hosts, even though the underlying uid number is different. But writing of files fails, since the numeric uid won't match. This took a while to notice.
Also libvirtd should have a common uid in order to make nfs storage share (and thus live-migration) to work.
What I had to do was to fix this:
1. set the nova uid in /etc/passwd to the same number in all hosts (e.g. 112)
2. set the libvirt-qemu uid in /etc/passwd to the same number in all hosts (e.g. 119)
3. set the nova group in /etc/group file to the same number in all hosts (e.g. 120)
4. set the libvirtd group in /etc/group file to the same number in all hosts (e.g. 119)
5. stop the services
6. change all the files owned by nova or group by nova, e.g.
6.1 find / -uid 108 -exec chown nova {} \; # note the 108 here is the old nova uid before the change
6.2 find / -gid 120 -exec chgrp nova {} \;
7. possibly the same for the libvirt-qemu owned files if those were needed to change
8. restart the services
If you had old uid and gid e.g. 108 and 120, do check that no such files exist anymore with old credentials:
find / -name proc -prune -o \( -uid 108 -o -gid 120 \) -exec ls -la {} \; | less
And while changing the uid and gid, make sure you don't use numbers that are already used for some other user/group. Make sure you come up with unique number.
This should be either instructed in prerequisites for nodes list, or added to the part where live-migration is discussed.
BR,
Ilkka Tengvall
Forgot to mention the crucial storage path:
by default it's /var/lib/ nova/instances, that's what hosts look by default for instance image files, and that's what we shared between hosts using NFS.