SmartOS add delegate dataset later to zone

Maybe you missed to add a delegate dataset to one of your SmartOS or LX-branded zone and would like to add it later. This is possible with zonecfg, but you're be warned this is only a workaround and not based on the official SmartOS documentation.

First find out your zone UUID and your zfs_filesystem:

$ vmadm list
# If your zone UUID is df779413-9943-481d-beb8-ba1a376afa2e
$ vmadm get df779413-9943-481d-beb8-ba1a376afa2e | json zfs_filesystem

I would recommend stop your zone before you create the dataset and modify the zone metadata:

$ vmadm stop df779413-9943-481d-beb8-ba1a376afa2e

Create your dataset / file system in the global zone. It should be called data and based on the already existing dataset:

$ zfs create zones/df779413-9943-481d-beb8-ba1a376afa2e/data

Modify the zone metadata with zonecfg:

$ zonecfg -z df779413-9943-481d-beb8-ba1a376afa2e

The commands will add the dataset which you've created earlier:

zonecfg:df779413-...> add dataset
zonecfg:df779413-...:dataset> set name=zones/df779413-9943-481d-beb8-ba1a376afa2e/data
zonecfg:df779413-...:dataset> end
zonecfg:df779413-...> verify
zonecfg:df779413-...> exit

After that you could start your zone again and should be able to see the new delegate dataset. You could check this also via vmadm:

$ vmadm get df779413-9943-481d-beb8-ba1a376afa2e | json datasets
[
  "zones/df779413-9943-481d-beb8-ba1a376afa2e/data"
]

Posted

December 21, 2016, 11:46 am

Tags

, , , , ,

More

Permalink

Comments

Send your comment by mail.