Skip to content

Instantly share code, notes, and snippets.

@mgerdts
Created January 23, 2018 23:50
Show Gist options
  • Save mgerdts/d063b8b0534c559480d87fac74f591aa to your computer and use it in GitHub Desktop.
Save mgerdts/d063b8b0534c559480d87fac74f591aa to your computer and use it in GitHub Desktop.
bhyve zone config
create -b
set zonepath=/zones/b2
set brand=bhyve
set autoboot=false
set limitpriv=default
set ip-type=exclusive
set uuid=fc0fbfdb-dbf6-c26d-9a5e-b20099b5ecf7
add net
set allowed-address=172.26.17.202
set physical=net0
set mac-addr=02:08:20:84:61:a2
set vlan-id=3317
set global-nic=ixgbe1
add property (name=gateway,value="172.26.17.1")
add property (name=gateways,value="172.26.17.1")
add property (name=netmask,value="255.255.255.0")
add property (name=ip,value="172.26.17.202")
add property (name=ips,value="172.26.17.202/24")
add property (name=model,value="virtio")
add property (name=primary,value="true")
end
add device
set match=/dev/zvol/rdsk/zones/b2-disk0
add property (name=boot,value="true")
add property (name=model,value="virtio")
add property (name=media,value="disk")
add property (name=image-size,value="10240")
add property (name=image-uuid,value="6aac0370-56b8-11e7-a29b-df1de8b42795")
end
add device
set match=/dev/zvol/rdsk/zones/b3-disk0
add property (name=model,value="virtio")
add property (name=media,value="disk")
add property (name=image-size,value="10240")
add property (name=image-uuid,value="6aac0370-56b8-11e7-a29b-df1de8b42795")
end
add rctl
set name=zone.cpu-shares
add value (priv=privileged,limit=100,action=none)
end
add rctl
set name=zone.max-lwps
add value (priv=privileged,limit=2000,action=deny)
end
add rctl
set name=zone.max-msg-ids
add value (priv=privileged,limit=4096,action=deny)
end
add rctl
set name=zone.max-sem-ids
add value (priv=privileged,limit=4096,action=deny)
end
add rctl
set name=zone.max-shm-ids
add value (priv=privileged,limit=4096,action=deny)
end
add rctl
set name=zone.max-shm-memory
add value (priv=privileged,limit=1610612736,action=deny)
end
add rctl
set name=zone.zfs-io-priority
add value (priv=privileged,limit=100,action=none)
end
add attr
set name=resolvers
set type=string
set value=8.8.8.8,8.8.4.4
end
add attr
set name=vcpus
set type=string
set value=4
end
add attr
set name=vm-autoboot
set type=string
set value=false
end
add attr
set name=dataset-uuid
set type=string
set value=fbd0d30b-65e1-ea38-ec78-8dad1c41d143
end
add attr
set name=vm-version
set type=string
set value=1
end
add attr
set name=ram
set type=string
set value=1g
end
add attr
set name=com1
set type=string
set value=/dev/zconsole
end
add attr
set name=bootrom
set type=string
set value=/usr/share/bhyve/BHYVE_UEFI.fd
end
add attr
set name=com2
set type=string
set value=socket,/com2
end
add dataset
set name=zones/b2/data
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment