Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FreeBSD node definition and instructions #51

Merged
merged 2 commits into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions node-definitions/freebsd/FreeBSD.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
id: FreeBSD
general:
nature: server
description: FreeBSD with "nuage-init" (a limited version of cloud-init).
read_only: false
device:
interfaces:
has_loopback_zero: true
physical:
- vtnet0
- vtnet1
- vtnet2
- vtnet3
- vtnet4
- vtnet5
- vtnet6
- vtnet7
serial_ports: 1
loopback:
- lo0
min_count: 1
default_count: 2
ui:
visible: true
label_prefix: fBSD-
icon: server
label: FreeBSD
sim:
linux_native:
libvirt_domain_driver: kvm
driver: server
disk_driver: sata
ram: 1024
cpus: 1
cpu_limit: 100
nic_driver: virtio
boot:
completed:
- 'login:'
timeout: 300
uses_regex: false
inherited:
image:
ram: true
cpus: true
cpu_limit: true
data_volume: true
boot_disk_size: true
node:
ram: true
cpus: true
cpu_limit: true
data_volume: true
boot_disk_size: true
configuration:
generator:
driver: server
provisioning:
volume_name: cidata
media_type: iso
files:
- name: meta-data
editable: true
content: |-
instance-id: freebsd-01
local-hostname: freebsd-01
- name: user-data
editable: true
content: |-
#cloud-config
users:
- name: cisco
plain_text_passwd: cisco
groups: wheel
schema_version: 0.0.1
58 changes: 58 additions & 0 deletions node-definitions/freebsd/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# FreeBSD in CML

Instructions for running a basic FreeBSD node in Cisco Modeling Lab.

# Deployable image

A pre-built FreeBSD image is available
[here](https://download.freebsd.org/snapshots/VM-IMAGES/14.1-STABLE/amd64/Latest/FreeBSD-14.1-STABLE-amd64-BASIC-CLOUDINIT.ufs.qcow2.xz).

In Linux the above image can be decomressed with:

xz --decompress FreeBSD-14.1-STABLE-amd64-BASIC-CLOUDINIT.ufs.qcow2.xz

From there the qcow2 file can be imported into CML.

By default the FreeBSD image is configured to use DHCP. It also supports a
native serial console which is ideal for CML.

# FreeBSD node definition

A FreeBSD [node definition](FreeBSD.yaml) is include in this directory.

# Limitations and future work

The FreeBSD 14.1 "Basic Cloud-init" image comes with "nuage-init" rather than
"cloud-init". Nuage-init does not support all options that are available in
cloud-init. A base configuration is provided in this
[node definition](FreeBSD.yaml).

If the CML node has Internet connectivity it is possible to use the package
manager to install cloud-init. This will allow you to use cloud-init on
subsequent boots. This approach may have limited utility if you are using
Terraform to provision the CML node.

## Nuage-init: MAC address required

If you are attempting to use Nuage-init in order to set an IP address please
have a look at the [source code](https://github.com/freebsd/freebsd-src/blob/f35ccf46c7c6cb7d26994ec5dc5926ea53be0116/libexec/nuageinit/nuageinit#L283-L293).

Nuage-init will explicitly check to see that there is an ```ethernets```
section with a ```match``` subsection. The only working match clause is the
```macaddress``` clause. If you do not explicitly state the MAC address of
thepurplebuffalo marked this conversation as resolved.
Show resolved Hide resolved
your NIC it will not be able to set an IP address. Both DHCP and IPv6 are
supported.

The following ```user-data``` example will set the IP address of the NIC with
the specified MAC address to 192.0.2.10/24.

```yaml
network:
version: 2
ethernets:
id0:
match:
macaddress: 'aa:bb:cc:00:11:22'
addresses:
- 192.0.2.10/24
```
Loading