remove refrences to flavor. use m1.small as the default flavor
diff --git a/plstackapi/core/models/sliver.py b/plstackapi/core/models/sliver.py
index 13f94b2..29858a4 100644
--- a/plstackapi/core/models/sliver.py
+++ b/plstackapi/core/models/sliver.py
@@ -14,8 +14,8 @@
class Sliver(PlCoreBase):
instance_id = models.CharField(max_length=200, help_text="Nova instance id")
name = models.CharField(max_length=200, help_text="Sliver name")
+ instance_name = models.CharField(blank=True, null=True, max_length=200, help_text="OpenStack generated name")
ip = models.GenericIPAddressField(help_text="Sliver ip address", blank=True, null=True)
- flavor = models.ForeignKey(Flavor, related_name='slivers')
image = models.ForeignKey(Image, related_name='slivers')
key = models.ForeignKey(Key, related_name='slivers')
slice = models.ForeignKey(Slice, related_name='slivers')
@@ -31,10 +31,10 @@
if not self.instance_id:
instance = self.driver.spawn_instance(name=self.name,
key_name = self.key.name,
- flavor_id = self.flavor.flavor_id,
image_id = self.image.image_id,
hostname = self.node.name )
self.instance_id = instance.id
+ self.instance_name = getattr(instance, 'OS-EXT-SRV-ATTR:instance_name')
super(Sliver, self).save(*args, **kwds)
diff --git a/plstackapi/core/serializers.py b/plstackapi/core/serializers.py
index 2cc88e0..381db05 100644
--- a/plstackapi/core/serializers.py
+++ b/plstackapi/core/serializers.py
@@ -151,7 +151,6 @@
class SliverSerializer(serializers.HyperlinkedModelSerializer):
# HyperlinkedModelSerializer doesn't include the id by default
id = serializers.Field()
- flavor = serializers.HyperlinkedRelatedField(view_name='flavor-detail')
image = serializers.HyperlinkedRelatedField(view_name='image-detail')
key = serializers.HyperlinkedRelatedField(view_name='key-detail')
slice = serializers.HyperlinkedRelatedField(view_name='slice-detail')
@@ -167,7 +166,6 @@
'instance_id',
'name',
'ip',
- 'flavor',
'image',
'key',
'slice',
@@ -193,18 +191,6 @@
'disk_format',
'container_format')
-class FlavorSerializer(serializers.HyperlinkedModelSerializer):
- # HyperlinkedModelSerializer doesn't include the id by default
- id = serializers.Field()
- class Meta:
- model = Flavor
- fields = ('id',
- 'flavor_id',
- 'name',
- 'memory_mb',
- 'disk_gb',
- 'vcpus')
-
serializerLookUp = {
Role: RoleSerializer,
PLUser: UserSerializer,
@@ -218,7 +204,6 @@
Sliver: SliverSerializer,
DeploymentNetwork: DeploymentNetworkSerializer,
Image: ImageSerializer,
- Flavor: FlavorSerializer,
None: None,
}