Passing user data python script down and it only runs until reboot
When I send user-data through to the openstack Boot Api I send a custom Python script. The python script is successfully place on the VM in /var/lib/cloud/instance/scripts/part-001
The script successfully starts and runs just fine. The issue I have is the script is not run again after reboot.
In our API I send a file over and base64 encode the contents (See Below json_utility).
public static final String REQUEST_PARAM_USER_DATA="user_data"; // nova cli: --user-data
String[][] paramValueArray = {
{ApiPostServers.REQUEST_PARAM_IMAGE_REF, imageRef},
{ApiPostServers.REQUEST_PARAM_FLAVOR_REF, flavorRef},
{ApiPostServers.REQUEST_PARAM_NETWORKS, networkListBuilder.toString()},
{ApiPostServers.REQUEST_PARAM_KEY_NAME, keyName},
{ApiPostServers.REQUEST_PARAM_MAX_COUNT, "1"},
{ApiPostServers.REQUEST_PARAM_MIN_COUNT, "1"},
{ApiPostServers.REQUEST_PARAM_SECURITY_GROUPS, "default"},
>>>>> {ApiPostServers.REQUEST_PARAM_USER_DATA, "/opt/ensemble/json_utility"},
{ApiPostServers.REQUEST_PARAM_META_DATA, ""},
{ApiPostServers.REQUEST_PARAM_AVAILABILITY_ZONE, "nova"}
Is there a way to have it run on reboot that would, presumably, leave it out of /etc/init.d?
What openstack api setting might I use to accomplish this?