Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specifying a default for the zoned property breaks delegated datasets #3

Open
bdha opened this issue May 13, 2015 · 1 comment
Open

Comments

@bdha
Copy link

bdha commented May 13, 2015

When delegating a dataset into a non-global zone, certain properties cannot be modified. zoned is one of those, as it's managed by the global zone exclusively.

The zfs cookbook sets a default of zoned: off, which causes convergence to fail when executed inside a zone:

https://github.com/marthag8/zfs/blob/master/resources/default.rb#L5

    Mixlib::ShellOut::ShellCommandFailed
    ------------------------------------
    Expected process to exit with [0], but received '1'
    ---- Begin output of zfs set zoned=off zones/b0ea2503-c8c5-68d4-a6a3-d55d0f526faa/data ----
    STDOUT:
    STDERR: cannot set property for 'zones/b0ea2503-c8c5-68d4-a6a3-d55d0f526faa/data': permission denied
    ---- End output of zfs set zoned=off zones/b0ea2503-c8c5-68d4-a6a3-d55d0f526faa/data ----
    Ran zfs set zoned=off zones/b0ea2503-c8c5-68d4-a6a3-d55d0f526faa/data returned 1

Attempting to modify the property at all is disallowed (and causes Chef to fail):

zfs set zoned=on zones/b0ea2503-c8c5-68d4-a6a3-d55d0f526faa/data
cannot set property for 'zones/b0ea2503-c8c5-68d4-a6a3-d55d0f526faa/data': permission denied

Is there a specific reason a default is defined?

Simply setting default to nil doesn't solve the problem:

    Mixlib::ShellOut::ShellCommandFailed
    ------------------------------------
    Expected process to exit with [0], but received '1'
    ---- Begin output of zfs set zoned= zones/b0ea2503-c8c5-68d4-a6a3-d55d0f526faa/data ----
    STDOUT:
    STDERR: cannot set property for 'zones/b0ea2503-c8c5-68d4-a6a3-d55d0f526faa/data': 'zoned' must be one of 'on | off'
    ---- End output of zfs set zoned= zones/b0ea2503-c8c5-68d4-a6a3-d55d0f526faa/data ----
    Ran zfs set zoned= zones/b0ea2503-c8c5-68d4-a6a3-d55d0f526faa/data returned 1
@bdha
Copy link
Author

bdha commented May 13, 2015

Ah, I see an exception got added to .6 for FreeBSD support. Cool!

This gets a bit weird, though... in most cases, the best way to determine I'm in a zone would be to use

virtualization[:system] == "zone"

but I'm wandering around the bleeding edge and using Joyent's new LX brand (with delegated ZFS datasets, no less!), so the best ohai entry to use is

kernel[:version] == "BrandZ virtual linux

I'm going to hack up something in the provider to account for this... totally open to suggestions on how to make it not suck, though!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant