[openstack-dev] forwarded message from Srikanth Kumar Lingala

Joseph VLcek jvlcek at redhat.com
Mon Oct 8 21:10:32 UTC 2012


> From: Srikanth Kumar Lingala <srikanthkumar.lingala at gmail.com>
> Date: October 4, 2012 8:04:04 AM EDT
> To: openstack-dev at lists.openstack.org
> Cc: openstack at lists.launchpad.net
> Subject: [Openstack] File Injection through Horizon
> 
> 
> Hi,
> I am trying to implement File Injection through Openstack Dashboard. That means, while creating instance from 'Launch Instance', I will give file path of a file, which I need to inject.
> For that, I modified the following file:
> 
> /usr/lib/python2.7/dist-packages/novaclient/v1_1/servers.py
> 
> In the above file, in the function 'create', I observed an argument 'files' wihch is taking 'None' by default. So, to test the primary functionality, I gave the 'files' argument statically in the function. For that, the first line of that function (Line no. 472) implementation, I defined 'files' as below:
> 
> fp = file('/root/inject.txt', 'r')
> files = {'/root/inject.txt':fp}
> 
> I followed two methods to create instance:
> 1. Through Openstack Dashboard
> 2. Through nova boot command from CLI
> 
> Method 1:
> After that, I restarted apache, and tried to create (launch) an instance from dashboard. It threw the following AJAX error, by clicking the Launch button:
> 
> Error: There was an error submitting the form. Please try again.
> 
> Method 2:
> If I did the same from nova boot command, the instance is creating and file injection is happening. Both methods are using the same above function 'create' in '/usr/lib/python2.7/dist-packages/novaclient/v1_1/servers.py'. 
> 
> I used the following nova boot command:
> #> nova boot --flavor=1 --image=4671e99b-1c01-42e8-94d6-2405a59bab57 testserver
> 
> Can you please let me know, what I am doing wrong here? And also, If I want to implement File Injection through Openstack Dashboard, what I need to modify?
> Thanks in advance.
> -- 
> ----
> Srikanth.
> 
> _______________________________________________
> Mailing list: https://launchpad.net/~openstack
> Post to     : openstack at lists.launchpad.net
> Unsubscribe : https://launchpad.net/~openstack
> More help   : https://help.launchpad.net/ListHelp
> 
> 


Hello Srikanth,

I am sorry but I am not familiar with the OpenStack dashboard or
/usr/lib/python2.7/dist-packages/novaclient/v1_1/servers.py

However I think you may find cloud-init valuable. https://help.ubuntu.com/community/CloudInit

Cloud-Init, once built into a client image, can be used to process data injected into a launch virtual
machine.

Cloud-Init is also available in EPEL and Fedora and soon to be in RHEL6.4

I just thought I would point it out as I think it could be valuable to you and the work
you are doing.

Joe VLcek




 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20121008/8be817fd/attachment-0001.html>


More information about the OpenStack-dev mailing list