softlayer / softlayer-python

A set of Python libraries that assist in calling the SoftLayer API.
http://softlayer.github.io/softlayer-python/
MIT License
152 stars 195 forks source link

Passing User Data Using Cloud-init with Softlayer #717

Closed tmadams333 closed 8 years ago

tmadams333 commented 8 years ago

We have been trying to provision machines in Softlayer using the SLCLI and were hoping to be able to pass user data to help our CM tool (chef) complete the machine install. We are provisioning the machine with the options below. The machine provisions fine, we log in to it, but there is no evidence that the user data was passed. Is there something that we are doing wrong?

slcli vs create --datacenter=sjc01 \     --hostname abc123abc123 \     --domain fishyard.net \     --key the_key \     --cpu 4 \     --memory 4096 \     --network 1000 \     --os COREOS_LATEST_64 \     --billing=monthly --userfile ~/slkporg2.yml

Here is the yml file:

cloud-config

chef: install_type: "omnibus" force_install: false   server_url: "https://10.91.142.13/organizations/chef"   environment: "_default"   validation_name: "chef-validator" validation_key: -----BEGIN RSA PRIVATE KEY----- YOUR-ORGS-VALIDATION-KEY-HERE -----END RSA PRIVATE KEY----- run_list:

We verified the userData has been set using this RESTful:

GET https://$Username:$APIKey@api.softlayer.com/rest/v3.1/SoftLayer_Virtual_Guest/$VSIID/getUserData

Note: Replace $VSIID with the id of your VSI

After including username and api key we get "no user data was found" request: getUserMetadata Unable to fetch item https://:@api.service.softlayer.com/rest/v3.1/SoftLayer_Resour‌​ce_Metadata/getUserMetadata.txt: status (404) body (No user data was found.) nil

softlayer-python version (slcli --version):slcli (SoftLayer Command-line), version 4.1.1

sudorandom commented 8 years ago

I would try with version 5.0.1. I'm not seeing what you're seeing when I attempted the same thing with that version.

curl https://api.service.softlayer.com/rest/v3.1/SoftLayer_Resource_Metadata/UserMetadata.json
riddopic commented 8 years ago

Hi,

This is what I am seeing, what are you seeing?

curl https://api.service.softlayer.com/rest/v3.1/SoftLayer_Resource_Metadata/UserMetadata.json

{"error":"No user data was found.","code":"SoftLayer_Exception_NotFound"}