[root@00-0c-29-aa-24-ba ~]# imgadm list
UUID NAME VERSION OS PUBLISHED
9eac5c0c-a941-11e2-a7dc-57a6b041988f base64 13.1.0 smartos 2013-04-26T15:17:57Z
Something like:
{
"autoboot": true,
"brand": "joyent",
"limit_priv": "default",
"image_uuid": "9eac5c0c-a941-11e2-a7dc-57a6b041988f",
"cpu_shares": 100,
"zfs_io_priority": 100,
"max_lwps": 2000,
"max_physical_memory": 1024,
"max_locked_memory": 1024,
"max_swap": 1024,
"tmpfs": 1024,
"dns_domain": "local",
"nics": [
{
"interface": "net0",
"nic_tag": "admin",
"gateway": "192.168.1.254",
"primary": true,
"ip": "dhcp"
}
],
"resolvers": ["192.168.1.254"]
}
[root@00-0c-29-aa-24-ba ~]# vmadm create -f zone_manifest.json
Successfully created VM b79bbb1a-49c6-45b3-86a5-236351b5fadb
[root@00-0c-29-aa-24-ba ~]# zlogin b79bbb1a-49c6-45b3-86a5-236351b5fadb
[root@b79bbb1a-49c6-45b3-86a5-236351b5fadb ~]# pkgin upgrade smtools
[root@b79bbb1a-49c6-45b3-86a5-236351b5fadb ~]# sm-prepare-image -y
(Now the zone is stopped and I'm back in the global zone)
[root@00-0c-29-aa-24-ba ~]# zfs snapshot zones/b79bbb1a-49c6-45b3-86a5-236351b5fadb@image
[root@00-0c-29-aa-24-ba ~]# zfs send zones/b79bbb1a-49c6-45b3-86a5-236351b5fadb@image | bzip2 > /var/myimage.zfs.bz2
{
"uuid": "b3f82236-04e9-11e3-8d1a-d70b21edc1ea",
"name": "smartos-myimage",
"version": "0.1.0",
"description": "Base template",
"os": "smartos",
"type": "zone-dataset",
"platform_type": "smartos",
"cloud_name": "ntrace",
"urn": "myimage:myimage:smartos:0.1.0",
"creator_name": "ntrace",
"creator_uuid": "7f1048c8-04d0-11e3-a69b-6350796da5e3",
"vendor_uuid": "7f1048c8-04d0-11e3-a69b-6350796da5e3",
"created_at": "2013-08-14T08:45Z",
"updated_at": "2013-08-14T08:45Z",
"published_at": "2013-08-11T08:45Z",
"files": [
{
"path": "myimage-0.1.0.zfs.bz2",
"sha1": "8dccfba39cda8b8e5227fd2202aca1f0693fa98c",
"size": 73869108,
"url": "URL HERE"
}
],
"requirements": {
"networks": [
{
"name": "net0",
"description": "public"
}
]
}
}
[root@00-0c-29-aa-24-ba ~]# imgadm install -m image_manifest.json -f /var/myimage.zfs.bz2
b3f82236-04e9-11e3-8d1a-d70b21edc1ea [=======================================================================================================================================================================>] 100% 70.45MB 1.41MB/s 49s
Installed image b3f82236-04e9-11e3-8d1a-d70b21edc1ea to "zones/b3f82236-04e9-11e3-8d1a-d70b21edc1ea".
{
"autoboot": true,
"limit_priv": "default",
"brand": "joyent",
"image_uuid": "b3f82236-04e9-11e3-8d1a-d70b21edc1ea",
"cpu_shares": 100,
"zfs_io_priority": 100,
"max_lwps": 2000,
"max_physical_memory": 1024,
"max_locked_memory": 1024,
"max_swap": 1024,
"tmpfs": 1024,
"dns_domain": "local",
"nics": [
{
"interface": "net0",
"nic_tag": "admin",
"gateway": "192.168.1.254",
"primary": true,
"ip": "dhcp"
}
],
"resolvers": ["192.168.1.254"]
}
[root@00-0c-29-aa-24-ba ~]# vmadm create -f zone_manifest_2.json