[manila]: Add Share Replicas support#2635
Conversation
3e9e672 to
2dbc38a
Compare
|
@mandre @pierreprinetti ready for review |
|
@mandre @pierreprinetti kindly ping |
|
any updates on this PR? |
About to take a look. Stay tuned :) |
| // The availability zone of the share | ||
| AvailabilityZone string `json:"availability_zone,omitempty"` | ||
| // One or more scheduler_hints key and value pairs as a dictionary of strings | ||
| SchedulerHints map[string]string `json:"scheduler_hints,omitempty"` |
There was a problem hiding this comment.
Scheduler hints were added in the 2.67 microversion API (yoga). Perhaps add that as a comment so that users know not to use it unless they have a recent OpenStack.
| // The availability zone of the share replica | ||
| AvailabilityZone string `json:"availability_zone"` | ||
| // Indicates whether existing access rules will be cast to read/only | ||
| CastRulesToReadonly bool `json:"cast_rules_to_readonly"` |
There was a problem hiding this comment.
Wouldn't it be better to have a separate type for brief and detailed results? As it is now, I can see it be quite confusing, especially for boolean fields, where it can returns false on a List() call, while returning true on a ListDetail() one.
This is a broader topic that we'll eventually need to tackle as part of the List() function consolidation (#2554). Please share your thoughts.
There was a problem hiding this comment.
IMHO, adding an extra struct type would add even more confusion, especially when the results may be used within a single scope. BTW, the same bool issue can be faced with the is_admin_only field in the ExportLocation struct:
This parameter is only available to users with an “administrator” role, and cannot be controlled via policy .json.
Maybe it makes sense to use pointers to indicate whether the bool value is set?
Also, listing replica export locations doesn't return created/updated timestamps, while getting a single export location does. I don't think that we need to define an extra struct for this case as well.
| // otherwise we need to set "X-OpenStack-Manila-API-Experimental: true" | ||
| const replicasMicroversion = "2.60" | ||
|
|
||
| func skipReplicaTests(t *testing.T) { |
There was a problem hiding this comment.
Please provide a comment explaining why these tests are skipped.
Have you tried changing the devstack config to support replication? This is how we configure it for our manila jobs.
Alternatively, perhaps we could skip the test when manila returns a 400 error with "Replication not supported for share", as in https://github.com/gophercloud/gophercloud/actions/runs/5097431904/jobs/9163951294#step:5:978 instead of disabling them altogether?
There was a problem hiding this comment.
I suspect adding replication_type=readable to MANILA_DEFAULT_SHARE_TYPE_EXTRA_SPECS might do the trick.
There was a problem hiding this comment.
Unfortunately I haven't managed to enable the replication (which requires ZFS on Linux) support. I disabled it again.
There was a problem hiding this comment.
I added an OS_MANILA_REPLICAS env check to run manila replicas acceptance tests.
8260be7 to
e18cf83
Compare
|
@mandre is there anything else I can do? |
No, it's waiting on me, sorry. Just haven't had the chance to get back to reviewing your PR yet.
edit: forget my question, I now understand we need to set OS_MANILA_REPLICAS variable if the env supports Manila replicas, which our job currently does not. |
|
@mandre we can try to setup the env with zfs that supports replicas later, but IMO it won't be easy. Locally I test with NetApp backend, it works great. |
Fixes #2633
Looks like devstack doesn't support replicas. Here is the output of local tests: