- vm_name = entity.attributes['occi.compute.hostname']
- info = snf.create_server(vm_name, flavor_id, image_id)
- entity.attributes['occi.core.id'] = str(info['id'])
- entity.attributes['occi.compute.cores'] = flavor.attributes['occi.compute.cores']
- entity.attributes['occi.compute.memory'] = flavor.attributes['occi.compute.memory']
+ entity.actions = [START]
+ entity.attributes['occi.compute.state'] = 'inactive'
+ entity.attributes['occi.core.id'] = str(info['id'])
+ entity.attributes['occi.compute.architecture'] = SERVER_CONFIG['compute_arch']
+ entity.attributes['occi.compute.cores'] = flavor.attributes['occi.compute.cores']
+ entity.attributes['occi.compute.memory'] = flavor.attributes['occi.compute.memory']
+ entity.attributes['occi.compute.hostname'] = SERVER_CONFIG['hostname'] % {'id':info['id']}
+
+ except (UnboundLocalError, KeyError) as e:
+ raise HTTPError(406, 'Missing details about compute instance')
+