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

Renaming a cloned jail does not rename the name of the snapshot it is based on (OR: Recursive destroy shows old name of renamed dependent jail) #53

Open
5 tasks done
grembo opened this issue Dec 3, 2024 · 0 comments

Comments

@grembo
Copy link
Contributor

grembo commented Dec 3, 2024

See also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=240371

Make sure to follow and check these boxes before submitting an issue! Thank you.

  • Supply iocage --version: Version 1.8
  • Supply the commands used, along with any steps to recreate it.
iocage create --name basejail -r 13.4-RELEASE
iocage clone basejail --name depjail
iocage rename depjail depjail2
iocage destroy --recursive basejail
  • Provide the output from the command you issued.
[root@jailhost-b ~]# iocage create --name basejail -r 13.4-RELEASE
basejail successfully created!
[root@jailhost-b ~]# iocage clone basejail --name depjail
depjail successfully cloned!
[root@jailhost-b ~]# iocage rename depjail depjail2
Jail: depjail renamed to depjail2
[root@jailhost-b ~]# iocage destroy basejail

This will destroy jail basejail

Are you sure? [y/N]: y

basejail has dependent jails (who may also have dependents), use --recursive to destroy: 
  depjail
  • Supply what you expected the result or output to be

This should show

basejail has dependent jails (who may also have dependents), use --recursive to destroy: 
  depjail2
  • Checked that the problem has not already been fixed on master if using
    a stable release.

The root of the problem is that the name of the dependent jails is determined by looking at the snapshot name.

So in the example above, the snapshots are still named @depjail after renaming:

zroot/iocage/jails/basejail@depjail                            0B      -      108K  -
zroot/iocage/jails/basejail/root@depjail                       0B      -     1.49G  -

Theoretically it could be possible to rename the snapshots to the new name on rename (which would also be less confusing when administering the system):

zfs rename -r zroot/iocage/jails/basejail@depjail  zroot/iocage/jails/basejail@depjail2

In which case the destroy command works as expected:

[root@jailhost-b ~]#  iocage destroy basejail

This will destroy jail basejail

Are you sure? [y/N]: y

basejail has dependent jails (who may also have dependents), use --recursive to destroy: 
  depjail2

I didn't check how complex this would be to fix in the rename command.

@grembo grembo changed the title Renaming a cloned jail does not rename the name of the snapshot (OR: Recursive destroy shows old name of renamed dependent jail) Renaming a cloned jail does not rename the name of the snapshot it is based on (OR: Recursive destroy shows old name of renamed dependent jail) Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant