- # 2. do the corresponding dc.startCompute(name="foobar") calls
- print "start %r" % docker_name
- # 3. store references to the compute objects in self.instantiations
+ target_dc = vnfd.get("dc")
+ # 4. perform some checks to ensure we can start the container
+ assert(docker_name is not None)
+ assert(target_dc is not None)
+ if not self._check_docker_image_exists(docker_name):
+ raise Exception("Docker image %r not found. Abort." % docker_name)
+ # 5. do the dc.startCompute(name="foobar") call to run the container
+ # TODO consider flavors, and other annotations
+ vnfi = target_dc.startCompute(GK.get_next_vnf_name(), image=docker_name, flavor_name="small")
+ # 6. store references to the compute objects in self.instances
+ self.instances[instance_uuid]["vnf_instances"].append(vnfi)
+ LOG.info("Service started. Instance id: %r" % instance_uuid)