Skip to content

Instantly share code, notes, and snippets.

@blackwood821
Created March 23, 2022 13:48
Show Gist options
  • Save blackwood821/cb09dde3b716715149d565804a90ef67 to your computer and use it in GitHub Desktop.
Save blackwood821/cb09dde3b716715149d565804a90ef67 to your computer and use it in GitHub Desktop.
Triton CN Encryption Setup Log
[2021-05-03T15:28:32Z] ./joysetup.sh:374: create_zpool(): /usr/bin/mkzpool -B -e zones /tmp/pool.json
fatal error: pool creation failed: create-zpool: illegal option -- B
Unknown option -B
Usage: kbmadm create-zpool [-g guid] [-t template] -- <zpool create args>...
       kbmadm recover [-c cfgnum] dataset
       kbmadm unlock [-r] dataset...
       kbmadm recovery add [-a] [-t template] [-r recovery_token] dataset
       kbmadm recovery list [-p] dataset
       kbmadm recovery activate dataset
       kbmadm recovery cancel dataset

[2021-05-03T15:28:32Z] ./joysetup.sh:376: create_zpool(): /usr/bin/mkzpool -e zones /tmp/pool.json
[2021-05-03T15:28:50Z] ./joysetup.sh:382: create_zpool(): zfs set atime=off zones
@blackwood821
Copy link
Author

Here's the code from /var/tmp/joysetup.sh on my CN running PI joyent_20210325T002528Z:

if /usr/bin/mkzpool -B ${e_flag} ${SYS_ZPOOL} ${POOL_JSON}; then
            printf "\n%-56s          (as potentially bootable)" >&4
        elif ! /usr/bin/mkzpool ${e_flag} ${SYS_ZPOOL} ${POOL_JSON}; then
            printf "%6s\n" "failed" >&4
            fatal "failed to create pool"
        fi

@teutat3s
Copy link

on our CN with PI 20220118T183559Z there's an additional flag -f in the elif statement, introduced by this commit:
TritonDataCenter/sdc-headnode@c601f46

        if mkzpool -B -f ${e_flag} "${SYS_ZPOOL}" "${POOL_JSON}"; then
            printf "\n%-56s          (as potentially bootable)" "" >&4
            bootable=yes
        elif ! mkzpool -f ${e_flag} "${SYS_ZPOOL}" "${POOL_JSON}"; then
            printf "%6s\n" "failed" >&4
            fatal "failed to create pool"
        fi

@danmcd
Copy link

danmcd commented Mar 24, 2022

That was introduced in two parts:

The -B (bootable) path with -f came in with TRITON-2188, and the comment above it explains why. That came in with Triton release 20210128. After that it would fail, but then the non-bootable attempt would get tried.

The non-bootable path was introduced with TRITON-2233, solving a similar problem specific to Linux CNs (but would be a NOP for SmartOS ones). That came in with Triton release 20210715, and it's where @teutat3s 's full bug first appeared.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment