Hello, node = self.driver.create_node(name, image, size, location, > ex_create_attr=options)
Second argument to create_node is size, not image, that why it's not working for you (it tries to find an image with the size id so it returns an error). To avoid such issues in the future, please always use keyword arguments when possible. So: node = self.driver.create_node(name=name, size=size, image=image, > location=location, > ex_create_attr=options) On Thu, Dec 31, 2015 at 1:06 PM, David Montgomery <[email protected] > wrote: > Wowee.....It worked yesterday but now i get the below. I go back to rest > with DO...no issues. > > I mean...I list images, I find the image I want to use...yet I get the > below error where the same code worked yesterday. I have to revert back to > rest which works with out fail. > > Why the variance with libclould? I have tried for years to get libclould to > work with ec2 and DO. I always have to revert back to rest for DO and boto > with ec2. I will probably try again in another year. > > > > Thanks > > > image: <NodeImage: id=14782728, name=14.04.3 x64, driver=DigitalOcean ...> > getting locations > location <NodeLocation: id=sfo1, name=San Francisco 1, country=None, > driver=DigitalOcean> > getting sizes > size: <NodeSize: id=4gb, name=4gb, ram=4096 disk=60 bandwidth=4.0 > price=0.05952 driver=DigitalOcean ...> > [u'239839'] > Traceback (most recent call last): > File "/home/ubuntu/workspace/new-devops/health_check.py", line 37, in > <module> > lcw.boot(server_type,node_name) > File "/home/ubuntu/workspace/new-devops/classes/libcloud_wrapper.py", > line 212, in boot > node = self.driver.create_node(name, image, size, location, > ex_create_attr=options) > File > > "/usr/local/lib/python2.7/dist-packages/libcloud/compute/drivers/digitalocean.py", > line 400, in create_node > data=json.dumps(attr), method='POST') > File "/usr/local/lib/python2.7/dist-packages/libcloud/common/base.py", > line 797, in request > response = responseCls(**kwargs) > File "/usr/local/lib/python2.7/dist-packages/libcloud/common/base.py", > line 143, in __init__ > headers=self.headers) > libcloud.common.exceptions.BaseHTTPError: You specified an invalid image > for Droplet creation. (code: 422) >
