-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
shared block support - libopenstorage extensions #2470
base: release-9.9
Are you sure you want to change the base?
Conversation
e86325d
to
25d6405
Compare
f521d58
to
eea8ca2
Compare
eea8ca2
to
ca857ac
Compare
// OptionsMigrateVolume control volume migration of shared raw block devices in kubevirt env for VMs | ||
// - Attach | ||
// This option indicates the next active coordinator node - machineID is expected | ||
OptionsMigrateVolume = "VOLUME_MIGRATE_TO_MACHINE" | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does the above change need to be part of this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the above change allows VM migration to be tested through CLI.
The entire shared block and VM migration features are developed and tested together.
api/spec/spec_handler.go
Outdated
@@ -894,6 +907,9 @@ func (d *specHandler) SpecOptsFromString( | |||
if ok, fsFormatOptions := d.getVal(SpecFsFormatOptionsRegex, str); ok { | |||
opts[api.SpecFsFormatOptions] = fsFormatOptions | |||
} | |||
if ok, shared := d.getVal(sharedBlockRegex, str); ok { | |||
opts[api.SpecSharedBlock] = shared | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is spec_handler_test.go, can we add unit tests there as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added UT
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good. Just add a unit test case in spec-handelr_test.go and the migration option how it is relevant to current PR, is not very clear. I possible separate out adding of spec and migration related code into two different PR.s
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
overall looks good but I have left some comments for you to consider.
uint32 source_node = 3; // source migration internal node id | ||
string source_machine = 4; // source migration external machine id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need both (here and below ?) Ideally you should use only machine_id
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This structure is used only for testing migration workflow.
source_machine is the external cli interface (pxctl host attach --migrate <machine id> vol
)
source_node is the conversion to internal px-storage node id.
they are setup part of the spec, so grpc can push them along to px-storage. grpc does not have access to methods to do conversion.
api/api.proto
Outdated
MULTI_NODE_SINGLE_WRITER = 4; // read many write one volume support | ||
MULTI_NODE_MULTI_WRITER = 5; // unrestricted rwx | ||
SINGLE_NODE_SINGLE_WRITER = 6; // read write vol, from a single node | ||
SINGLE_NODE_MULTI_WRITER = 7; // px default volume support |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove "px"
api/api.proto
Outdated
@@ -706,6 +732,8 @@ message VolumeSpec { | |||
bool near_sync = 51; | |||
// NearSyncReplicationStrategy is replication strategy for near sync volumes | |||
NearSyncReplicationStrategy near_sync_replication_strategy = 52; | |||
// shared_block is true if this volume can be concurrently accessed by multiple nodes | |||
bool shared_block = 54; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we just add access mode enum member instead of another bool ? (shared, sharedv4, shared_block ?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 on enum. Today RWO raw block is dictated through FSType field set to None instead of an explicit field for access. We could use the AccessMode to dictate RWO/RWX/ROX etc and another enum called volumeMode to dictate Block/File
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lots of this code is carried over for legacy reasons. I will convert shared_block to an enum, but will not touch other pieces of code that want to use this field.
// vm migration support | ||
Migration migration = 33; | ||
// ExportedOn tracks attached volumes on multiple nodes for RWX and ROX volumes | ||
repeated string exported_on = 34; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Between attached_on and exported_on which field takes precedence?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
px is still single coordinator logic.
attached_on is primary active coordinator.
exported_on is all encompassing inclusive of passive coordinators.
most of the code and logic should rely on existing attached_on.
only those logic that needs to work for srb should look at exported_on
api/spec/spec_handler.go
Outdated
@@ -106,6 +106,7 @@ var ( | |||
haRegex = regexp.MustCompile(api.SpecHaLevel + "=([0-9]+),?") | |||
cosRegex = regexp.MustCompile(api.SpecPriority + "=([A-Za-z]+),?") | |||
sharedRegex = regexp.MustCompile(api.SpecShared + "=([A-Za-z]+),?") | |||
sharedBlockRegex = regexp.MustCompile(api.SpecSharedBlock + "=([A-Za-z]+),?") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would avoid defining anything here in spec handler since that results into a new storage class parameter which can be totally avoided by relying solely on PVC's accessMode & volumeMode fields.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I carried forward existing framework. csi spec does indeed carry right recommendations. i will focus on getting this field properly initialized without special storageclass needs.
Signed-off-by: lsundararajan <[email protected]>
Signed-off-by: lsundararajan <[email protected]>
Signed-off-by: lsundararajan <[email protected]>
5eb123b
to
c8abd44
Compare
Signed-off-by: lsundararajan <[email protected]>
Signed-off-by: lsundararajan <[email protected]>
Signed-off-by: lsundararajan <[email protected]>
Signed-off-by: lsundararajan <[email protected]>
Signed-off-by: lsundararajan <[email protected]>
Signed-off-by: lsundararajan <[email protected]>
What this PR does / why we need it:
Explain the PR and why it is needed.
Shared raw block extensions of libopenstorage - basic and necessary infra extensions only carved out of poc effort.
full poc here: https://github.com/pure-px/porx/pull/13673
Which issue(s) this PR fixes (optional)
PWX# https://purestorage.atlassian.net/browse/PWX-38767
Testing Notes
Add testing output or passing unit test output here.
Special notes for your reviewer:
Add any notes for the reviewer here.