Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Triton DataCenter and SmartOS Cloud Images

The Triton DataCenter and SmartOS cloud images repo was based on AlmaLinux cloud-images repo.

This project uses Packer templates and and Ansible for building the images.

Build details

  • Images are produce using packer and the distro's native installer automation mechanism.
  • ansible is used to prepare the image contents.
  • Swap is disabled in all kickstarts, and preseed configurations.
  • cloud-init is used for provision-time guest configuration.
  • triton-guest systemd service will set hostid and root password from generated metadata.

Available Images

Name Version
AlmaLinux 8
AlmaLinux 9
AlmaLinux 10
Debian 12
Debian 13
Oracle Linux 8
Oracle Linux 9
Oracle Linux 10
Rocky Linux 8
Rocky Linux 9
Rocky Linux 10
Ubuntu 22.04
Ubuntu 24.04
Windows Server 2025

Requirements

Only building on SmartOS with bhyve is supported. When building on SmartOS, the build script will ensure any necessary dependencies are correctly installed. Building with Linux using the qemu plugin is theoretically possible, but the build script cannot be used. Also due to divergences in ZFS on Linux and illumos ZFS, zfs datasets from Linux cannot be imported to SmartOS.

Images produced will be usable with KVM as well as Bhyve.

The settings for the build virtual machine is currently 4 CPUs, 4G of ram, and 10G of disk. Make sure your build zone allocation has well in excess of that available during the build process.

Windows Server 2025

The Windows Server 2025 image uses evaluation media that expires after 180 days. Build it directly with Packer, or use the build script to also produce the image manifest:

packer build --only=bhyve.windows-2025-x86_64 .
./build_all.sh windows-2025

The build attaches no guest NIC (host_nic is empty) because it runs in a non-global zone that cannot create VNICs. The communicator = "none" build delivers everything on CD and requires a packer-plugin-bhyve build with the companion optional-NIC change.

The following details are important when maintaining this image:

  • Boot-critical storage drivers must arrive in $WinPEDriver$ at the CD root because wpeinit scans only the root of each volume. Do not prefix cd_files entries with ./, or the SDK reproduces the whole source path on the CD. A file entry is placed at the CD root under its basename; a directory entry contributes its last component and everything below it, so windows-2025/$WinPEDriver$ becomes \$WinPEDriver$. Adding DriverPaths for the same INFs makes Setup fail with 0x80070103.
  • The virtio drivers are pinned to virtio-win 0.1.271 (100.100.104.27100). Do not update them without retesting on Triton: 0.1.285 binds the virtio-net device and then fails with CM_PROB_FAILED_POST_START, leaving a dead NIC. The trailing version digits identify the virtio-win release. Triton's bhyve presents legacy virtio unless the zone sets virtio1=true, which maps to bhyve's virtio.modern; re-evaluate newer drivers once platform images carry that setting.
  • The build ends with sysprep /generalize /oobe /shutdown as a first-logon command. Setup overrides a shutdown in the specialize pass with its own restart. The /unattend: argument prevents the generalized image from running the build answer file again on a customer's first boot.
  • At first boot, SetupComplete.cmd applies the per-instance Administrator password from metadata, while the TritonNetworking startup task applies networking metadata. The image manifest enables generate_passwords for the administrator user.

Building with Bhyve and packer on SmartOS

We have created a packer plugin for bhyve that works with SmartOS (and should be compatible with other illumos distributions). Please report any issues that you find.

Building images requires additional services to be installed, running, and properly configured. The build script will attempt to make the proper modifications to the build environment. Because of this, building images should be done in a zone dedicated for this purpose, and not general purpose dev environments.

Granting permission for a zone to use Bhyve

You must use a joyent brand zone base-64-lts@22.4.0 with a delegated dataset. The nic will need "allow_ip_spoofing": true. If you are using a stand-alone SmartOS server, add this to the JSON when creating the zone. If you are using Triton, you will need to add it via NAPI (AdminUI can also be used). For example:

sdc-napi /nics/00:53:37:aa:bb:cc -X PUT -d '{"allow_ip_spoofing": true}'

After provisioning some additional zone setup is required to grant the zone access to the bhyve devices. This must be done on the compute node and is not something you should grant to untrusted tenants.

zonecfg -z <uuid> <<EOF
set limitpriv=default,proc_clock_highres,sys_dl_config
add device
set match="/dev/viona"
end
add device
set match="/dev/vmm*"
end
commit
exit
EOF

The build script will handle configuring networking, NAT, and routing.

Build Guest Network Configuration

Note: This entire section is for reference only. Network configuration and services are handled by the build script but it is included here to help readers understand how networking is configured for the image creation process. This section may help diagnose any networking problems encountered during image generation.

Interface Configuration

isc-dhcpd listens on dhcp0 and hosts the packer http server, and then packer0 is what bhyve uses for the VM. Note: isdc-dhcpd may go into maintenance when the zone boots if the dhcp0 interface isn't present.

dladm create-etherstub -t images0
dladm create-vnic -t -l images0 dhcp0
dladm create-vnic -t -l images0 packer0
ifconfig dhcp0 plumb up
ifconfig packer0 plumb
ifconfig dhcp0 10.0.0.1 netmask 255.255.255.0

NAT Configuration

# cat > /etc/ipf/ipnat.conf <<EOF
map net0 10.0.0.10/32 -> 0/32
EOF
# routeadm -u -e ipv4-forwarding
# svcadm enable ipfilter
# ipnat -l

dhcp server configuration

Note: This will be handled for you by the build script. This is for reference only.

/opt/local/etc/dhcp/dhcpd.conf:

authoritative;

subnet 10.0.0.0 netmask 255.255.255.0 {
        option routers 10.0.0.1;
        option domain-name-servers 1.1.1.1;
        range 10.0.0.10 10.0.0.20;
}

Generate Images

The available build targets can be discovered with:

./build_all.sh list

To generate images for all targets, run:

./build_all.sh

To generate images for a subset of targets, pass only targets you wish to create:

./build_all.sh <target1> <target2>

About

Triton Cloud Image Creator

Resources

Stars

10 stars

Watchers

6 watching

Forks

Releases

Packages

Used by

Contributors

Languages