openstack team mailing list archive
-
openstack team
-
Mailing list archive
-
Message #02819
Re: Injecting user data into instances
User data is provided to the vm through the ec2 metadata url. It is not touched by the hypervisor at all. It does work for regular user data and for cloudpipe. The smoketests also verify that user data is working in the SecurityGroupTests by passing in a script proxy script that runs on boot.
Vish
On Jun 8, 2011, at 5:36 PM, Vladimir Popovski wrote:
> Folks,
>
> Have anybody tried to inject user data into instances? Or if anybody actually tried to use Cloudpipe / VPN functionality?
>
> It seems like there is some code missing (at least on libvirt/connection level).
>
> If I’m not missing anything, EC2 RunInstances takes user_data from kwargs arguments and provides it to compute_api, who stores it in base_options / instances table.
> Cloudpipe’s launch_vpn_instance also goes through the same path. However, there is no any parser of user_data field on compute manager / driver level.
>
> For example, if we will look at spawn implementation in libvirt:
>
> it calls _create_image(instance, …
> , who calls
> disk.inject_data(basepath('disk'), key, net, partition=target_partition, nbd=FLAGS.use_cow_images)
> where image is mounted as nbd device and key/net information is inserted by
>
> inject_data_into_fs(tmpdir, key, net, utils.execute)
> _inject_key_into_fs
> _inject_net_into_fs
>
> It seems reasonable to pass user data to disk.inject_data and inject_data_into_fs and inject it into FS as well, but there is no such code …
>
> Or am I missing anything?
>
>
> Another interesting situation is with inject_file compute APIs …
>
> on API level there is no even file/contents fields, only
> def inject_file(self, context, instance_id):
> but they exist on compute.manager level:
> def inject_file(self, context, instance_id, path, file_contents):
>
>
> Thanks,
> -Vladimir
> _______________________________________________
> Mailing list: https://launchpad.net/~openstack
> Post to : openstack@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~openstack
> More help : https://help.launchpad.net/ListHelp
Follow ups
References