← Back to team overview

openstack team mailing list archive

Re: Instance fails to spawn when instance_path is nfs mounted

 

All,

On the link given below vish asked if I could “chown” the files in that folder – turns out I couldn’t.
I’ve answered his query on the link below – but repeating the updates here for larger audience (Unfortunately,  I have revived a question that is marked as “solved” – so not many people may refer/respond to the link)


Vish :

> 1) is it possible to chown files on your nfs mount?

Not sure whom should I give the ownership to ? As the dir listing shows above, the files are created with correct owner/group settings. These files were created by nova-compute process.

I "touch"ed a file for testing - which was created with "mandar:mandar" - I tried changing the ownership, but I keep getting "invalid" argument - not sure if that is what you were referring to ..

mandar@ubuntu-dev-mandar:~/nfs_shared_instances_path$ touch x
mandar@ubuntu-dev-mandar:~/nfs_shared_instances_path$ ll
total 16
drwxrwxrwx  4 root   root     4096 2012-04-04 03:46 ./
drwxr-xr-x 15 mandar mandar   4096 2012-04-04 03:39 ../
drwxrwxr-x  2 mandar libvirtd 4096 2012-04-04 02:18 _base/
drwxr-xr-x  2 mandar libvirtd 4096 2012-04-04 03:41 instance-0000000f/
-rw-rw-r--  1 mandar mandar      0 2012-04-04 03:46 x
mandar@ubuntu-dev-mandar:~/nfs_shared_instances_path$ chown root x
chown: changing ownership of `x': Invalid argument
mandar@ubuntu-dev-mandar:~/nfs_shared_instances_path$ ll
total 16
drwxrwxrwx  4 root   root     4096 2012-04-04 03:46 ./
drwxr-xr-x 15 mandar mandar   4096 2012-04-04 03:39 ../
drwxrwxr-x  2 mandar libvirtd 4096 2012-04-04 02:18 _base/
drwxr-xr-x  2 mandar libvirtd 4096 2012-04-04 03:41 instance-0000000f/
-rw-rw-r--  1 mandar mandar      0 2012-04-04 03:46 x
mandar@ubuntu-dev-mandar:~/nfs_shared_instances_path$ sudo chown root x
chown: changing ownership of `x': Invalid argument
mandar@ubuntu-dev-mandar:~/nfs_shared_instances_path$ chgrp libvirtd x
chgrp: changing group of `x': Invalid argument
mandar@ubuntu-dev-mandar:~/nfs_shared_instances_path$ sudo chgrp libvirtd x
chgrp: changing group of `x': Invalid argument


I also debugged the "_chown_console_log_for_instance" in "nova/virt/libvirt/connection.py"
and with breakpoint before "if os.path.exists(console_log)"  - I touched "console.log" at the appropriate path from another terminal.

Over there also I am getting the same error:

2012-04-04 03:56:55 TRACE nova.rpc.amqp Command: sudo /usr/local/bin/nova-rootwrap chown 1000 /home/mandar/nfs_shared_instances_path/instance-00000010/console.log
2012-04-04 03:56:55 TRACE nova.rpc.amqp Exit code: 1
2012-04-04 03:56:55 TRACE nova.rpc.amqp Stdout: ''
2012-04-04 03:56:55 TRACE nova.rpc.amqp Stderr: "/bin/chown: changing ownership of `/home/mandar/nfs_shared_instances_path/instance-00000010/console.log': Invalid argument\n"

So what is the fix for this ?



-Mandar

From: openstack-bounces+mandar.vaze=vertex.co.in@xxxxxxxxxxxxxxxxxxx [mailto:openstack-bounces+mandar.vaze=vertex.co.in@xxxxxxxxxxxxxxxxxxx] On Behalf Of Mandar Vaze / ????? ???
Sent: Tuesday, April 03, 2012 10:14 PM
To: openstack@xxxxxxxxxxxxxxxxxxx
Subject: [Openstack] Instance fails to spawn when instance_path is nfs mounted

I saw an old question posted here :
https://answers.launchpad.net/nova/+question/164689

But I am not trying live migration.

I have nfs mounted instances_path - so when I try to spawn an instance I
run into the above errors. Especially following :

File "/usr/lib/python2.7/dist-packages/libvirt.py", line 372, in createWithFlags
40842 2012-04-03 05:42:27 TRACE nova.rpc.amqp     if ret == -1: raise libvirtError ('virDomainCreateWithFlags() failed', dom=self)
40843 2012-04-03 05:42:27 TRACE nova.rpc.amqp libvirtError: internal error Process exited while reading console log output: chardev: opening       backend "file" failed

But as you can see below, several files are created in this folder, so I
am not sure if mine if permissions issue (Else none of the files would
get created) The problem is reported when libvirt tries to write to
console.log (File itself is created with correct permissions - just that
this is zero byte file)

mandar@ubuntu-dev-mandar:/nfs_shared_instances_path/instance-00000005$ ll
total 10944
drwxrwxr-x 2 mandar libvirtd    4096 2012-04-03 05:42 ./
drwxrwxrwx 4 root   root        4096 2012-04-03 05:42 ../
-rw-rw---- 1 mandar libvirtd       0 2012-04-03 05:42 console.log
-rw-r--r-- 1 mandar libvirtd 6291968 2012-04-03 05:42 disk
-rw-rw-r-- 1 mandar libvirtd 4731440 2012-04-03 05:42 kernel
-rw-rw-r-- 1 mandar libvirtd    1067 2012-04-03 05:42 libvirt.xml
-rw-rw-r-- 1 mandar libvirtd 2254249 2012-04-03 05:42 ramdisk

I'm suspecting : https://bugs.launchpad.net/ubuntu/maverick/+source/libvirt/+bug/632696
But I the above doesn't show itself in non-NFS setup

Please suggest !!!

-Mandar


______________________________________________________________________
Disclaimer:This email and any attachments are sent in strictest confidence for the sole use of the addressee and may contain legally privileged, confidential, and proprietary data.  If you are not the intended recipient, please advise the sender by replying promptly to this email and then delete and destroy this email and any attachments without any further use, copying or forwarding