Add validation hooks for volume type extra specs
When adding/setting volume type extra spec key/values, we should allow the volume backend specified in volume_
Use case:
For example, the 3PAR driver has many options it can accept for extra specs on a volume. One of those settings is the 'hp3par_cpg' extra spec key. A 3PAR CPG is a pool of available space to provision volumes.
1) An administrator creates a volume type called "Gold"
2) The administrator sets the 'volume_
3) The administrator adds/sets the 'hp3par_cpg' extra spec key with a value of 'MySSDRaid1CPG'.
Result:
Since the volume_backend_name is specified, cinder would know which driver to call to request validation for the hp3par_cpg key. The 3PAR driver's validate method would be called, and it would see if the 'MYSSDRaid1CPG' exists on the 3PAR it's configured to manage. If the CPG exists, it returns a success, if the CPG doesn't exist it would raise an Exception saying that the CPG doesn't exist. The cinder command line tool would puke out an error with the contents of the Exception message. The extra spec key is NOT set in the database at this point, because it's invalid.
This lets the administrator right then, that the value for the hp3par_cpg key is invalid, and the extra spec key isn't in the volume type.
Issues:
If there is no volume_backend_name specified at the time the admin sets the extra spec key, then no validation call to a driver can't happen. Cinder doesn't know which backend to call.
Workaround:
The workaround for the lack of validation today is to:
1) create the volume type
2) add the extra spec keys/values
3) try and create a volume. If it works, you know the keys are mostly valid. Some extra spec keys/values may only be used at volume attach time. The 3PAR driver has a extra spec key of 'hp3par_persona', which is only used at volume attach time.
Blueprint information
- Status:
- Complete
- Approver:
- None
- Priority:
- Undefined
- Drafter:
- None
- Direction:
- Needs approval
- Assignee:
- None
- Definition:
- Obsolete
- Series goal:
- None
- Implementation:
- Unknown
- Milestone target:
- None
- Started by
- Completed by
- Sean McGinnis
Related branches
Related bugs
Sprints
Whiteboard
(smcginnis): Marking obsolete as this has been sitting out there for a long time. If this is still needed, please submit a new bp.
Gerrit topic: https:/
Addressed by: https:/
Validate volume type extra specs
Gerrit topic: https:/
Addressed by: https:/
Validate volume type extra specs
Gerrit topic: https:/
Addressed by: https:/
Add HP3PAR validate volume type extra spec
Addressed by: https:/
Add HPLeftHand validate volume type extra spec