Delete or Reset Application Dataset (ix-applications) on Scale

HarryMuscle

Contributor
Joined
Nov 15, 2021
Messages
161
Is there a way to delete or reset the applications dataset (the actual dataset is called ix-applications)? The only way I think it might be possible is by changing the application dataset to another pool, then deleting the original dataset, and changing things back to the original pool. I'm hoping there's an easier or faster way.

Thanks,
Harry
 

psudo

Cadet
Joined
Jul 12, 2022
Messages
1
Did you ever find a method to do that.
Im in a similar situation.
TIA
/Jesper
 

HarryMuscle

Contributor
Joined
Nov 15, 2021
Messages
161
Did you ever find a method to do that.
Im in a similar situation.
TIA
/Jesper
Yes but via the API ... I'll try to dig up how I actually did it. The basic idea is you make an API call to set the application dataset to nothing/nowhere then delete the dataset (it might have deleted it for me, can't remember) and then set the application dataset to the location you want it either via the API or GUI to recreate it.
 
Joined
Nov 26, 2023
Messages
9
I'm in the same horrible boat. Unsetting and destroying the apps pool does no good. As soon as you declare a new one, the same broken app comes right back.
 

jakimcho

Cadet
Joined
Sep 23, 2019
Messages
3
Yes but via the API ... I'll try to dig up how I actually did it. The basic idea is you make an API call to set the application dataset to nothing/nowhere then delete the dataset (it might have deleted it for me, can't remember) and then set the application dataset to the location you want it either via the API or GUI to recreate it.
Man thank you for the hints. I lost all my day fighting this nightmere. Cannot believe that this is so hard.
What is did to delere the dataset is (note that probably some steps are not needed):

  1. First I logged to the truenas via ssh. You need to set up a ssh user in truenas with wheel Auxiliary group and to start the SSH service
  2. I entered in super user mode
    Code:
    sudo su
  3. Then I tried to remove the ix-application directory with the command
    • Code:
      rm -rf path_to_ix-applications
      . -> It complained that it is in used and a cannot delete it.
  4. Then I checked what is mount with the command
    • Code:
      mount | grep ix-applications
      . It listed several mounted points.
  5. I unmounted all one by one starting from the botton path (the lastmounted dir in the ix-applications)
    • Code:
      umount dir_path
  6. Obtain API token in order to use the truenas open api:
    1701623226413.png
    1. Note that you should keep it since you can not doulbe check it
  7. Then go to the Open API guide page (the "Guide" menu item from above menu) or http://{truenas_ip}/api/docs/ and selected "RESTful 2.0" tab
  8. Check what services you have there. I used Postman setting a Bearer token authentication using the API key from the 1st step:
    1. GET http://{truenas_ip}/api/v2.0/pool/dataset -> checked what is the id of my dataset. It was the path to ix-applications
    2. GET http://{truenas_ip}/api/v2.0/zfs/snapshot -> checked what is the idof the snapshot that was holding the snapshot
    3. POST http://{truenas_ip}/api/v2.0/zfs/snapshot/release : body {
      "id": "{snapshot_id}",
      "options": {"recursive":true}
      } -> Release the snapshot
    4. DELETE http://{truenas_ip}/api/v2.0/zfs/snapshot/id/{snapshot_id} -> note that you need to encode the "/" with "%2F" in the name of the nsapshot id
    5. DELETE http://{truenas_ip}/api/v2.0/pool/dataset/id/{dataset_id} -> note that you need to encode the "/" with "%2F" in the name of the dataset id
And finaly I made it.
 

pawelr

Cadet
Joined
Dec 21, 2023
Messages
2
Unset the pool. Destroy dataset: "zfs destroy -r TANK_NAME/ix-applications". Go to Settings -> Advanced settings, change anything and commit. Change it back. Set the pool. And now you have clean applications service.
 
Top