imsplitbit/nova — pull request #2 by Shrews (2012-07-17 18:40:40+00:00)
Title: Add SSH key injection support to OpenVZ driver

Add code to inject a SSH key for root into each container. It creates a /root/.ssh directory for each container, then outputs the key to authorized_keys.

Note that OpenVzConnection.inject_file() was not used because it (a) does not create directories, and (b) it will not work unless the user has write permission on container private directories (e.g. /var/lib/vz/private/1). I used a method similar to what is used in nova/virt/disk/api.py.