plumb flavors through to openstack
diff --git a/planetstack/openstack/driver.py b/planetstack/openstack/driver.py
index c3e1f35..4f1c177 100644
--- a/planetstack/openstack/driver.py
+++ b/planetstack/openstack/driver.py
@@ -417,11 +417,12 @@
return (subnet_id, subnet)
- def spawn_instance(self, name, key_name=None, hostname=None, image_id=None, security_group=None, pubkeys=[], nics=None, metadata=None, userdata=None):
- flavor_name = self.config.nova_default_flavor
+ def spawn_instance(self, name, key_name=None, hostname=None, image_id=None, security_group=None, pubkeys=[], nics=None, metadata=None, userdata=None, flavor_name=None):
+ if not flavor_name:
+ flavor_name = self.config.nova_default_flavor
+
flavor = self.shell.nova.flavors.find(name=flavor_name)
- #if not image:
- # image = self.config.nova_default_imave
+
if not security_group:
security_group = self.config.nova_default_security_group
diff --git a/planetstack/openstack_observer/steps/sync_slivers.py b/planetstack/openstack_observer/steps/sync_slivers.py
index 299b02f..dcedd1d 100644
--- a/planetstack/openstack_observer/steps/sync_slivers.py
+++ b/planetstack/openstack_observer/steps/sync_slivers.py
@@ -86,7 +86,8 @@
hostname = sliver.node.name,
pubkeys = pubkeys,
nics = nics,
- userdata = userData )
+ userdata = userData,
+ flavor_name = sliver.flavor.flavor )
sliver.instance_id = instance.id
sliver.instance_name = getattr(instance, 'OS-EXT-SRV-ATTR:instance_name')
sliver.save()