A profile is an object instantiated from a “profile type” and it is used as the specification for creating a physical object to be managed by Senlin. The “physical” adjective here is used to differentiate such an object from its counterpart, the “logical” object, which is referred to as a node in Senlin.
As the specification for physical object creation, a profile contains almost every piece of information needed for the underlying driver to create an object. After a physical object is created, its UUID will be assigned to the physical_id property of a node as reference. When a physical object is deleted, the physical_id property will be set to None.
Although not required, a profile may reference the node object’s properties when creating a physical object. For example, a profile may use the node’s index property value for generating a name for the object; a profile may customize an object’s property based on the role property value of a node. It is up to the profile type author and the specific use case how a profile is making use of the properties of a node.
A profile object has the following properties:
The spec property is the most important property for a profile. It is immutable, i.e. the only way to “change” the spec property is to create a new profile. By restricting changes to this property, Senlin can do a better job in managing the object configurations.
When creating a profile using the profile_create API, a user must provide the name and spec parameters. All other parameters are optional.
The provided spec map will be validated using the validation logic provided by the corresponding profile type. If the validation succeeds, the profile will be created and stored into the database. Senlin engine returns the details of the profile as a dict back to Senlin API and eventually to the requesting user. If the validation fails, Senlin engine returns an error message describing the reason of the failure.
Senlin profiles an API for listing all profiles known to the Senlin engine. When querying the profiles, users can provide any of the following parameters:
If there are profiles matching the query criteria, Senlin API returns a list named profiles where each entry is a JSON map containing details about a profile object. Otherwise, an empty list or an error message will be returned depending on whether the query was well formed.
A user can provide one of the following values in attempt to retrieve the details of a specific profile.
Once a profile object is created, a user can request its properties to be updated. Updates to the name or metadata properties are applied on the specified profile object directly. Changing the spec property of a profile object is not permitted.
A user can provide one of profile UUID, profile name or a short ID of a profile when requesting a profile object to be deleted. Senlin engine will check if there are still any clusters or nodes using the specific profile. Since a profile in use cannot be deleted, if any such clusters or nodes are found, an error message will be returned to user.
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.