Validate attached volume types for cross-HV resize - #657
Conversation
Change-Id: I6103d68443bb422ad203a44c3145bdb8c1632379
3e72d93 to
b4046dd
Compare
| bdms = self._get_bdms() | ||
| return bdms.root_bdm() | ||
|
|
||
| def _get_cross_hv_expected_volume_type(self): |
There was a problem hiding this comment.
Can we cache the result? Volume types should be basically static and I don't think we should rely on the configured volume type becoming available after we rolled out Nova.
There was a problem hiding this comment.
Done. The first successful lookup is now cached for all successive operations. This also allows implicit retries in case initial lookups fail (e.g. cinder down).
There was a problem hiding this comment.
Is there private data that could be available to a non-admin token if the first lookup is by an admin token?
Would it make sense to limit the cached data to id and name, because that's the only attributes we care about? (minimal less memory, mitigating the first concern - future use-cases will have to explicitly add some attributes)
get_cross_hv_expected_volume_type() called get_all_volume_types() on every cross-HV resize attempt. A missing configured type would start working silently once an operator created the type, without a restart. Add a conductor-process cache in ComputeTaskManager. The first successful get_all_volume_types() call stores the result for the process lifetime. A Cinder failure is not cached so a later resize can retry. The cache is intentionally permanent until restart so that a misconfigured type cannot silently become valid after deployment. Pass the cache accessor into MigrationTask as get_volume_types_fn. The task falls back to a direct Cinder call when the function is not supplied, keeping all existing task tests unchanged. Change-Id: Ie913bc97311e014c6e4bb068df868fb64b7e4ddc
1cef125 to
a4ad370
Compare
Summary
Cross-HV resize supports only FCD-backed Cinder volumes at this time.
This change uses the newly introduced
[cross_hv] fcd_volume_typeto validate all attached Cinder volumes during cross-HV resize. Nova now rejects the resize if any attached volume does not use the configured FCD volume type. This covers:Same-HV resize behavior does not change. We currently only have one FCD volume type.