Skip to content

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

@grembo

Description

@grembo

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions