nimbusproject / nimbus

Nimbus - Open Source Cloud Computing Software - 100% Apache2 licensed
http://www.nimbusproject.org/
197 stars 82 forks source link

Query API doesn't allow newlines in Base64-encoded userdata #110

Closed labisso closed 12 years ago

labisso commented 12 years ago

Userdata included in RunInstances requests must be Base64-encoded, according the the EC2 API. Some base64 encoders (notably openssl) include newlines to break the output into lines. Nimbus does not allow newlines in the encoded data, but EC2 apparently does.

Nimbus validates the userdata here: https://github.com/nimbusproject/nimbus/blob/master/messaging/gt4.0-elastic/java/msgbridge/src/org/nimbustools/messaging/gt4_0_elastic/v2008_05_05/rm/defaults/DefaultRun.java#L195

I was able to reproduce this using boto, but had to step into the internals a bit as boto does its own base64 encoding:


params = {'ImageId': "theimage",
        'MinCount': 1,
        'MaxCount': 1,
        'UserData': base64_data_with_newlines}
ec2conn.get_object('RunInstances', params, Reservation, verb='POST')

Thanks to Anthony Tiradani for the bug report.