diff --git a/IM/InfrastructureInfo.py b/IM/InfrastructureInfo.py index ad7f7416a..7e3b7da99 100644 --- a/IM/InfrastructureInfo.py +++ b/IM/InfrastructureInfo.py @@ -306,17 +306,16 @@ def update_radl(self, radl, deployed_vms): """ with self._lock: - # Add new networks only - for s in radl.systems + radl.networks + radl.ansible_hosts: + original_radl = self.radl.clone() + # Add new networks ad ansible_hosts only + for s in radl.networks + radl.ansible_hosts: if not self.radl.add(s.clone(), "ignore"): - InfrastructureInfo.logger.warn( - "Ignoring the redefinition of %s %s" % (type(s), s.getId())) + InfrastructureInfo.logger.warn("Ignoring the redefinition of %s %s" % (type(s), s.getId())) - # Add or update configures + # Add or update configures and systems for s in radl.configures + radl.systems: self.radl.add(s.clone(), "replace") - InfrastructureInfo.logger.warn( - "(Re)definition of %s %s" % (type(s), s.getId())) + InfrastructureInfo.logger.warn("(Re)definition of %s %s" % (type(s), s.getId())) # Append contextualize self.radl.add(radl.contextualize) @@ -335,7 +334,12 @@ def update_radl(self, radl, deployed_vms): self.private_networks[private_net] = d.cloud_id # Check the RADL - self.radl.check() + try: + self.radl.check() + except Exception as ex: + # If something is not correct restore the original one and raise the error + self.radl = original_radl + raise(ex) def complete_radl(self, radl): """ diff --git a/doc/source/conf.py b/doc/source/conf.py index ef0c86c77..41e53ac7f 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -39,6 +39,7 @@ 'sphinx.ext.autodoc', 'sphinx.ext.mathjax', 'sphinx.ext.viewcode', + 'sphinx.ext.graphviz' ] # Math diff --git a/doc/source/xmlrpc.rst b/doc/source/xmlrpc.rst index fafbd636a..7063ba077 100644 --- a/doc/source/xmlrpc.rst +++ b/doc/source/xmlrpc.rst @@ -62,6 +62,17 @@ This is the list of method names: Return the aggregated state associated to the infrastructure with ID ``infId``. + The ``state`` can be + + * ``pending``, At least one VM is still in initialization stage; + * ``running``, All the VMs are created successfully and running, but at least one of them are still in the configuration stage; + * ``configured``, All the VMs are running and contextualized; + * ``unconfigured``, All the VMs are running but at least one of them are not correctly contextualized; + * ``stopped``, All the VMs are stopped or suspended; + * ``off``, All the VMs are shutdown or removed from the infrastructure; + * ``failed``, There are at least one VM in status ``failed``. + * ``unknown``, There are at least one VM in status ``unknown``. + ``GetInfrastructureRADL`` :parameter 0: ``infId``: integer :parameter 1: ``auth``: array of structs