Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save madsmith/0bae9551c506457043020b0842f29069 to your computer and use it in GitHub Desktop.
Save madsmith/0bae9551c506457043020b0842f29069 to your computer and use it in GitHub Desktop.
Adding a zfs dataset to a SmartOS zone. Seems there's no vmadm api for this, but you can do it with zonecfg:
# vmadm halt <uuid>
# zonecfg -z <uuid>
zonecfg:uuid> add dataset
zonecfg:uuid:dataset> set name=<zfs/path>
zonecfg:uuid:dataset> end
zonecfg:uuid> commit
zonecfg:uuid> exit
# zfs set mountpoint=legacy <zfs/path>
# vmadm boot <uuid>
@madsmith
Copy link
Author

I'm not entirely sure as to why the author proposed setting the mountpoint to legacy. My testing with this shows that the zfs dataset then needs to be configured inside of the zone as it's no longer auto mounted by zfs. The zonecfg alone should be sufficient to expose the zfs dataset to the zone.

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