Skip to content

cannot destroy 'poolname/dataset/vm-100-disk-0': dataset is busy #214

@ybantya

Description

@ybantya

Modified Commands and Added Timeouts in /usr/share/perl5/PVE/Storage/LunCmd/FreeNAS.pm

Original:

# Remove the extent
my $remove_extent = freenas_iscsi_remove_extent($scfg, $lun->{'id'});

# Remove the link
my $remove_link = freenas_iscsi_remove_target_to_extent($scfg, $lun->{'id'});

Modified:

# Remove the link first
my $remove_link = freenas_iscsi_remove_target_to_extent($scfg, $lun->{'id'});

sleep(3);  # 3-second delay for cleanup

# Remove the extent
my $remove_extent = freenas_iscsi_remove_extent($scfg, $lun->{'id'});

sleep(3);  # 3-second delay for system stabilization

After updating the plugin, restart the API and statistics services:

systemctl restart pvedaemon.service && systemctl restart pvestatd.service

  • removes target associations before storage extents

  • allows TrueNAS to complete internal operations

  • reduces race conditions during deletion

  • ensures clean removal of iSCSI components

The sleep intervals provide necessary buffer time for the FreeNAS API to process each deletion step completely before proceeding.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions