no need to look up flavor and image by name. Just pass the id to servers.create()
diff --git a/plstackapi/core/api/slivers.py b/plstackapi/core/api/slivers.py
index c41ffba..a1589d2 100644
--- a/plstackapi/core/api/slivers.py
+++ b/plstackapi/core/api/slivers.py
@@ -42,16 +42,15 @@
if deployment_networks: fields['deploymentNetwork'] = deployment_networks[0]
nodes = _get_nodes(fields.get('node'))
if nodes: fields['node'] = nodes[0]
-
sliver = Sliver(**fields)
# create quantum sliver
- sliver = driver.spawn_instance(name=sliver.name,
+ instance = driver.spawn_instance(name=sliver.name,
key_name = sliver.key.name,
- flavor=sliver.flavor.name,
- image = sliver.image.name,
- hostname = sliver.node.hostname )
+ flavor_id = sliver.flavor.flavor_id,
+ image_id = sliver.image.image_id,
+ hostname = sliver.node.name )
- sliver.instance_id=sliver.id
+ sliver.instance_id=instance.id
sliver.save()
return sliver