Skip to content

Instantly share code, notes, and snippets.

@bdha
Created January 24, 2012 13:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bdha/1670178 to your computer and use it in GitHub Desktop.
Save bdha/1670178 to your computer and use it in GitHub Desktop.
{
"hostname": "test1",
"alias": "test1",
"brand": "ipkg",
"autoboot": "true",
"default_gateway": "10.0.1.1",
"dns_domain": "local",
"dataset_uuid": "templates/oi-151a",
"nics": [
{
"nic_tag": "admin",
"model": "virtio",
"ip": "10.0.1.90",
"netmask": "255.255.255.0",
"gateway": "10.0.1.1",
"resolvers": "10.0.1.1"
}
]
}
# vmadm create -f ipkg.json
^C
### Bugs:
### * Did something dumb to VM.js; even though the zone is created,
### `vmadm create` never returns.
# vmadm list
UUID TYPE RAM STATE ALIAS
f39b1a13-8e2e-4e85-835f-2fbba94f3732 OS 256 running test1
# zlogin f39b1a13-8e2e-4e85-835f-2fbba94f3732
[Connected to zone 'f39b1a13-8e2e-4e85-835f-2fbba94f3732' pts/3]
OpenIndiana (powered by illumos) SunOS 5.11 oi_151a September 2011
root@test1:~#
### Bugs:
### * IP not being set
### * vnic is delegated, but not plumbed
### * Can plumb with defined IP, and bring up
root@test1:~# ifconfig net0 plumb ; ifconfig net0 up
root@test1:~# ifconfig net0 10.0.1.91 netmask 255.255.255.0
root@test1:~# route add default 10.0.0.1
root@test1:~# echo "nameserver 10.0.1.1" > /etc/resolv.conf
root@test1:~# cp /etc/nsswitch.dns /etc/nsswitch.conf
root@test1:~# echo "10.0.1.91 test1" >> /etc/hosts
root@test1:~# pkg install pkg:/network/telnet
Packages to install: 1
Create boot environment: No
DOWNLOAD PKGS FILES XFER (MB)
Completed 1/1 4/4 0.1/0.1
PHASE ACTIONS
Install Phase 18/18
PHASE ITEMS
Package State Update Phase 1/1
Image State Update Phase 2/2
root@test1:~# pkg install apache-22
Packages to install: 5
Create boot environment: No
Services to restart: 1
DOWNLOAD PKGS FILES XFER (MB)
Completed 5/5 909/909 4.6/4.6
PHASE ACTIONS
Install Phase 1183/1183
PHASE ITEMS
Package State Update Phase 5/5
Image State Update Phase 2/2
root@test1:~# svcs -a | grep http
disabled 5:25:45 svc:/network/http:apache22
root@test1:~# svcadm enable apache22
root@test1:~# telnet localhost 80
Trying ::1...
Connected to localhost.
Escape character is '^]'.
GET /
<html><body><h1>It works!</h1></body></html>Connection to localhost closed by foreign host.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment