Skip to content
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

Volume From Snapshot Fails With Custom Node Ids #541

Open
jnels124 opened this issue Jun 6, 2024 · 3 comments · May be fixed by #549
Open

Volume From Snapshot Fails With Custom Node Ids #541

jnels124 opened this issue Jun 6, 2024 · 3 comments · May be fixed by #549
Labels
enhancement Add new functionality to existing feature Need community involvement Needs community involvement on some action item. waiting for contributor Waiting on the contribution from the community contributor.

Comments

@jnels124
Copy link
Contributor

jnels124 commented Jun 6, 2024

What steps did you take and what happened:
[A clear and concise description of what the bug is, and what commands you ran.]

  1. Label node(s) with unique value for openebs.io/nodeid
  2. Deploy zfs components
  3. Create a pvc with zfs storage class
  4. Identify volume created successfully
  5. Create a snapshot and ensure the appropriate zfs and k8s resources exist
  6. Create a new pvc defined to be created from snapshot
  7. Notice zfs volume created and after 10 minutes goes to pending
  8. Logs will indicate unable to find node with nodeid value from the owning node

What did you expect to happen:
It should utilize the correct ids when identifying the node and create the volume from snapshot successfully.

Anything else you would like to add:
We pre-label (before starting zfs components) our nodes with unique identifiers for openebs.io/nodeid and these identifiers differ from the node name.

With this configuration, I am able to create new ZFS volumes without issue. However, when you attempt to create a zfs volume from a snapshot definition it fails.

In the logs I can see failed to get the node {VALUE_OF_OPENEBS_NODEID} which highlights the issue. This GetNodeID method in volume.go only works when it is passed the nodename.

In the case of creating a new volume GetNodeID is called with the nodename but when it is from a volume clone or a snapshot it gets called with the value of openebs.io/nodeid. This is because this block here in driver/controller.go in the CreateVolume method:

if contentSource != nil && contentSource.GetSnapshot() != nil {
		snapshotID := contentSource.GetSnapshot().GetSnapshotId()

		selected, err = CreateSnapClone(ctx, req, snapshotID)
	} else if contentSource != nil && contentSource.GetVolume() != nil {
		srcVol := contentSource.GetVolume().GetVolumeId()
		selected, err = CreateVolClone(ctx, req, srcVol)
	} else {
		selected, err = CreateZFSVolume(ctx, req)
	}

CreateSnapClone --> returns spec.OwnerNodeId
CreateVolClone --> returns spec.OwnerNodeId
CreateZFSVolume --> returns nodename loop variable

Environment:

  • LocalPV-ZFS version: 4.0.1
  • Kubernetes version (use kubectl version): 1.29
  • Kubernetes installer & version: GKE
  • Cloud provider or hardware configuration:
  • OS (e.g. from /etc/os-release):
@Abhinandan-Purkait
Copy link
Member

@jnels124 Thanks for creating a separate issue. Would you be interested in taking this up or maybe you can create a design proposal for the same so that the community can review and take this forward. Thanks

@Abhinandan-Purkait Abhinandan-Purkait added Need community involvement Needs community involvement on some action item. waiting for contributor Waiting on the contribution from the community contributor. enhancement Add new functionality to existing feature labels Jun 7, 2024
@jnels124
Copy link
Contributor Author

@Abhinandan-Purkait should be able to get around to implementing the fix for this in the next few weeks

@Abhinandan-Purkait
Copy link
Member

@Abhinandan-Purkait should be able to get around to implementing the fix for this in the next few weeks

That's great!

@jnels124 jnels124 linked a pull request Jun 25, 2024 that will close this issue
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Add new functionality to existing feature Need community involvement Needs community involvement on some action item. waiting for contributor Waiting on the contribution from the community contributor.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants