import pool using midclt

byte0

Cadet
Joined
Nov 16, 2021
Messages
5
I am automating the setup of my TrueNAS installation using midclt. I am a bit confused.
I created a pool using zpool create. I would like to import that pool into TrueNAS so the GUI is aware of it.

pool.import_pool says I need a pool GUID that I can get from pool.import_find which returns a job id. I query core.get_jobs and find the job id, but there is not pool GUID information... I am very confused. Where to I get that GUID from?

midclt call core.get_jobs "[[\"id\",\"=\",1662]]"
{
"id": 1662,
"method": "pool.import_find",
"arguments": [],
"logs_path": null,
"logs_excerpt": null,
"progress": {
"percent": 100,
"description": null,
"extra": null
},
"result": [],
"error": null,
"exception": null,
"exc_info": null,
"state": "SUCCESS",
"time_started": {
"$date": 1637123928844
},
"time_finished": {
"$date": 1637123928982
}
}
No GUID...?
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
I think what you're seeing there is a no-data return...

if you manually run zpool import at the CLI, do you see the pool to be imported?

My guess is that in creating the pool, it's already imported, so there are none available for import.

Try exporting the pool after creation before running your API calls.
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
zpool get all <name of new pool> | grep uid

@sretalla is correct. When you create a pool, it's automatically imported.
 

byte0

Cadet
Joined
Nov 16, 2021
Messages
5
I will have to re-install to try this. I created the pool using the GUI and cannot destroy it.
 

byte0

Cadet
Joined
Nov 16, 2021
Messages
5
The reason I want to do this via command line is that since my TrueNAS is a Hyper-V VM, I want to be able to grow the pool by resizing the VHDX file. The GUI, however, creates partitions on the disk then adds the partitions to the pool preventing me from auto growing the pool after expanding the VHDX.
 

byte0

Cadet
Joined
Nov 16, 2021
Messages
5
Alright, so I found the option to expand the pool after resizing the .VHDX file. I assumed clicking the menu icon inline with the pool name is where the pool options/actions are, but the cog above the list has the expand action.
I guess I can do this all using the GUI/midclt after all.
Sorry friends, I'm learning.
 
Top