Last active
September 11, 2018 15:09
-
-
Save jperkin/5243605 to your computer and use it in GitHub Desktop.
Revisions
-
jperkin revised this gist
Mar 26, 2013 . 2 changed files with 7 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,13 +9,16 @@ Install cp NetBSD-6.0-amd64.iso /zones/$zoneuuid/root/netbsd.iso vmadm boot $zoneuuid order=cd,once=d cdrom=/netbsd.iso,ide vmadm info $zoneuuid vnc You can now VNC to vnc.host:vnc.port as per the output of the `vmadm info` command, and perform the OS install. Once the install is done, 'poweroff' in the VM. Create image ============ Take a snapshot of the installed image, update the image manifest with the image size and SHA1, then install it. zfs snapshot zones/$zoneuuid-disk0@snap zfs send !$ | gzip >netbsd6-0.0.1.zvol.gz ls -l !$ @@ -26,4 +29,6 @@ Create image Create new VMs ============== Finally, now that the image is installed, we can create as many NetBSD images from it as we want. vmadm create < netbsd.json This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,4 @@ { "brand": "kvm", "autoboot": true, "ram": 512, -
jperkin revised this gist
Mar 26, 2013 . 2 changed files with 1 addition and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -26,6 +26,4 @@ Create image Create new VMs ============== vmadm create < netbsd.json This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,3 @@ "brand": "kvm", "autoboot": true, "ram": 512, -
jperkin created this gist
Mar 26, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,31 @@ Instructions for building a NetBSD VM Install ======= vmadm create < netbsd-install.json vmadm list zoneuuid=... cp NetBSD-6.0-amd64.iso /zones/$zoneuuid/root/netbsd.iso vmadm boot $zoneuuid order=cd,once=d cdrom=/netbsd.iso,ide vmadm info $zoneuuid vnc open -a chicken vnc://vnc.host:vnc.port Once the install is done, 'poweroff' in the VM. Create image ============ zfs snapshot zones/$zoneuuid-disk0@snap zfs send !$ | gzip >netbsd6-0.0.1.zvol.gz ls -l !$ digest -a sha1 !$ vi netbsd6-0.0.1.json # add size and sha1 imgadm install -m netbsd6-0.0.1.json -f netbsd6-0.0.1.zvol.gz Create new VMs ============== vi netbsd.json # change image_uuid vmadm create < netbsd.json This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ { "brand": "kvm", "autoboot": false, "ram": 512, "disks": [ { "boot": true, "model": "virtio", "size": 2048 } ], "nics": [ { "nic_tag": "admin", "model": "virtio", "ip": "dhcp" } ] } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,36 @@ { "v": 2, "uuid": "93bfa14a-931c-11e2-88ec-abddd29e435d", "owner": "0ca387a2-92d2-11e2-b623-6b615ec71835", "name": "netbsd-6.0-amd64", "version": "0.0.1", "state": "active", "disabled": false, "public": true, "published_at": "2013-03-23T00:00:00Z", "type": "zvol", "os": "netbsd", "files": [ { "sha1": "f577ab706ffd4567fae09858a1da3ddcce272542", "size": 59148086, "compression": "gzip" } ], "description": "NetBSD/amd64 6.0 Minimal Install", "urn": "smartos:jperkin:netbsd-6.0-amd64:0.0.1", "requirements": { "networks": [ { "name": "net0", "description": "public" } ], "ssh_key": true }, "acl": [], "nic_driver": "virtio", "disk_driver": "virtio", "cpu_type": "qemu64", "image_size": 2048 } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ "brand": "kvm", "autoboot": true, "ram": 512, "alias": "netbsd6", "disks": [ { "boot": true, "model": "virtio", "image_uuid": "93bfa14a-931c-11e2-88ec-abddd29e435d", "image_size": 2048 } ], "nics": [ { "nic_tag": "admin", "model": "virtio", "ip": "dhcp" } ] }