Project

General

Profile

Bug #35062

Avatar?id=55038&size=50x50

Stop iocage jails before locking drive that contains jails

Added by Zackary Welch 10 months ago. Updated 9 months ago.

Status:
Done
Priority:
No priority
Assignee:
Brandon Schneider
Category:
Middleware
Target version:
Seen in:
Severity:
Medium
Reason for Closing:
Reason for Blocked:
Needs QA:
No
Needs Doc:
No
Needs Merging:
No
Needs Automation:
No
Support Suite Ticket:
n/a
Hardware Configuration:
ChangeLog Required:
No

Description

When locking a pool that has a jail currently up, I get an error when trying to lock the jail. The error's text is just "Error." This seems to be an error reporting problem with the middleware, but I don't know for sure. If I stop the jail first before locking then it works fine. Should the jail stop when locking the pool? At least the error should be more descriptive than just "Error".

output.mp4 (402 KB) output.mp4 Zackary Welch, 06/15/2018 12:08 PM
Screen Shot 2018-07-27 at 1.39.48 PM.png (30.3 KB) Screen Shot 2018-07-27 at 1.39.48 PM.png Bonnie Follweiler, 07/27/2018 10:43 AM
Screen Shot 2018-07-27 at 1.40.07 PM.png (27.6 KB) Screen Shot 2018-07-27 at 1.40.07 PM.png Confirming it is locked Bonnie Follweiler, 07/27/2018 10:43 AM
Screen Shot 2018-07-31 at 9.13.17 AM.png (19.8 KB) Screen Shot 2018-07-31 at 9.13.17 AM.png unlocked Bonnie Follweiler, 07/31/2018 06:14 AM
Screen Shot 2018-07-31 at 9.11.03 AM.png (11 KB) Screen Shot 2018-07-31 at 9.11.03 AM.png locked Bonnie Follweiler, 07/31/2018 06:14 AM
22982
22992
23216
23221

Related issues

Related to FreeNAS - Bug #30852: Start iocage jails after volume is unlockedDone
Blocked by FreeNAS - Bug #37706: Fix bad caching on list_resource in Jails Wizard in new UIDone

Associated revisions

Revision 1900bb66 (diff)
Added by Brandon Schneider 10 months ago

fix(storage/locking_volumes): Stop iocage jails before doing so

This will make sure things can be restarted in a graceful state on unlock

Ticket: #35062

Revision 40ced66e (diff)
Added by Brandon Schneider 9 months ago

fix(storage/locking_volumes): Stop iocage jails before doing so (#1395)

  • fix(storage/locking_volumes): Stop iocage jails before doing so

This will make sure things can be restarted in a graceful state on unlock

Ticket: #35062

  • Address Williams Review

Revision 02703cff (diff)
Added by Brandon Schneider 9 months ago

fix(notifier/volume_detach): Stop jails related to the volume

Previously it only handled one use case, this makes sure both the New and Old UI properly stop all jails related to a volume being detached. (Not just locked)

Ticket: #35062

Revision f14b2ed0 (diff)
Added by Brandon Schneider 9 months ago

tkt-35062: fix(notifier/volume_detach): Stop jails related to the volume (#1606)

fix(notifier/volume_detach): Stop jails related to the volume

Previously it only handled one use case, this makes sure both the New and Old UI properly stop all jails related to a volume being detached. (Not just locked)

Ticket: #35062

History

#1 Updated by Bonnie Follweiler 10 months ago

  • Related to Bug #30852: Start iocage jails after volume is unlocked added

#2 Updated by Dru Lavigne 10 months ago

  • Assignee changed from Release Council to William Grzybowski

#3 Updated by William Grzybowski 10 months ago

  • Assignee changed from William Grzybowski to Brandon Schneider
  • Target version changed from Backlog to 11.2-BETA1
  • Severity changed from Low Medium to Medium

#4 Updated by Brandon Schneider 10 months ago

  • Status changed from Unscreened to Not Started

#5 Updated by Brandon Schneider 10 months ago

  • Status changed from Not Started to In Progress

#6 Updated by Brandon Schneider 10 months ago

#7 Updated by Dru Lavigne 10 months ago

  • Target version changed from 11.2-BETA1 to 11.2-BETA2

#8 Updated by Brandon Schneider 9 months ago

  • Status changed from In Progress to Ready for Testing

DESC: Stop jails before locking volumes
RISK: Low
ACCEPTANCE: Have running iocage jails, lock the volume. They should now not be running.

#9 Updated by Dru Lavigne 9 months ago

  • Subject changed from Iocage non-desciptive error when locking drive with a running jail to Stop iocage jails before locking drive with a running jail
  • Needs Doc changed from Yes to No
  • Needs Merging changed from Yes to No

#10 Updated by Bonnie Follweiler 9 months ago

  • Status changed from Ready for Testing to Blocked
  • Reason for Blocked set to Dependent on a related task to be completed

A Jail can't be built until https://redmine.ixsystems.com/issues/37706 is fixed

#11 Updated by Dru Lavigne 9 months ago

  • Blocked by Bug #37706: Fix bad caching on list_resource in Jails Wizard in new UI added

#12 Updated by Dru Lavigne 9 months ago

  • Status changed from Blocked to Ready for Testing

#14 Updated by Aaron St. John 9 months ago

  • Status changed from Ready for Testing to Failed Testing

I tested this ticket by creating a new, encrypted pool. I then created a pass phrase so that I could lock/unlock the pool.

Next, I made sure the pool was unlocked. I then activated iocage for that specific pool by:

iocage activate _PoolName_

Since the correct pool had been activated I then created the jail through the shell commands as well as started the jail.

Now that I had an unlocked, encrypted pool with a jail installed and running, I locked the pool.

However, it didn't just "stop" jail. It appeared to have temporarily deactivated iocage for that specific pool.
When I went to the shell and used

iocage list

it automatically activated iocage on a different pool that hadn't had iocage activated on it before.

Furthermore, I continued on and unlocked the pool. The jail was running.

I'm not sure if this is the behaviour that is desired, but that's what appeared to happen.

#15 Updated by Dru Lavigne 9 months ago

  • Subject changed from Stop iocage jails before locking drive with a running jail to Stop iocage jails before locking drive that contains jails
  • Reason for Blocked deleted (Dependent on a related task to be completed)

#16 Updated by Brandon Schneider 9 months ago

Aaron:

So if you make a locked pool, activate it, create a jail and then lock the pool, what does jls show?

#17 Updated by Aaron St. John 9 months ago

The jails section displayed no available jails when the pool is locked and encrypted.

#18 Updated by Brandon Schneider 9 months ago

  • Status changed from Failed Testing to Ready for Testing

Aaron: That's how iocage functions. It automatically activates the first pool it finds, in this case that new pool was your next target. If the jail section is empty, this passed testing.

Please do this exactly:

- iocage clean -af
- zfs inherit -r org.freebsd.ioc:active POOL <--- Do that for each pool in your system
- zfs destroy -rf POOL/iocage <--- Do that for every pool so we can be *sure* they're all gone
- Create your encrypted pool
- iocage activate ENCPOOL
- iocage create -n foo -r 11.1-RELEASE boot=on
- run jls and see that there is a jail showing
- Now lock the ENCPOOL
- jls <--- This should now be empty. Do not run another iocage command.

#19 Updated by Bonnie Follweiler 9 months ago

22982
22992

in FreeNAS-11.2-MASTER-201807270859
(Build Date: Jul 27, 2018 12:10)

- Now lock the ENCPOOL
- jls <--- This should now be empty. Do not run another iocage command.

It wasn't empty (screenshot provided)

#20 Updated by Bug Clerk 9 months ago

  • Status changed from Failed Testing to In Progress

#21 Updated by Brandon Schneider 9 months ago

New PR: https://github.com/freenas/freenas/pull/1606

Works locally:

root@freenas:~/iocage # zpool status tank
  pool: tank
 state: ONLINE
  scan: none requested
config:

        NAME                                              STATE     READ WRITE CKSUM
        tank                                              ONLINE       0     0     0
          gptid/9dfbac38-9147-11e8-9f02-8badac78d086.eli  ONLINE       0     0     0

errors: No known data errors
root@freenas:~/iocage # iocage activate tank
ZFS pool 'tank' successfully activated.
root@freenas:~/iocage # iocage fetch -r 11.1-RELEASE --server newmordor.home --noupdate
Creating tank/iocage
Creating tank/iocage/download
Creating tank/iocage/images
Creating tank/iocage/jails
Creating tank/iocage/log
Creating tank/iocage/releases
Creating tank/iocage/templates
Fetching: 11.1-RELEASE

Downloading : MANIFEST [####################] 100% 
Downloading : base.txz [####################] 100% 
Downloading : lib32.txz [####################] 100%
Downloading : doc.txz [####################] 100%
Downloading : src.txz [####################] 100%
Extracting: base.txz...
Extracting: lib32.txz...
Extracting: doc.txz...
Extracting: src.txz...
root@freenas:~/iocage # iocage create -n foo -r 11.1-RELEASE boot=on
foo successfully created!
* Starting foo
  + Started OK
  + Starting services OK
root@freenas:~/iocage # jls
   JID  IP Address      Hostname                      Path
     1                  foo                           /mnt/iocage/jails/foo/root
LOCKED ENC VOLUME
root@freenas:~/iocage # zpool status tank
cannot open 'tank': no such pool
root@freenas:~/iocage # jls
   JID  IP Address      Hostname                      Path

#22 Updated by Bug Clerk 9 months ago

  • Status changed from In Progress to Ready for Testing

#23 Updated by Bonnie Follweiler 9 months ago

  • Status changed from Ready for Testing to Passed Testing
  • Needs QA changed from Yes to No

Test passed in FreeNAS-11.2-MASTER-201807301851
(Build Date: Jul 30, 2018 21:59)

#25 Updated by Dru Lavigne 9 months ago

  • Status changed from Passed Testing to Done

Also available in: Atom PDF