Notes sur l’installation d’une machine OpenBSD sous smartos.

Création du réseau privé.

dladm create-etherstub perso0
dladm create-vnic -l perso0 gwperso0
#ifconfig gwperso0 plumb
#ifconfig gwperso0 inet 192.168.50.1 up

Ne pas oublier le autoboot à false.

{
  "brand": "kvm",
  "ram": "2048",
  "vcpus": "1",
  "hostname": "openbsd",
  "alias": "openbsd",
  "autoboot": false,
  "resolvers": [
      "8.8.8.8",
      "8.8.4.4"
  ],
  "nics": [
    {
      "nic_tag": "puffy",
      "model": "virtio",
      "primary": true,
      "ip": "XXX.XXX.XXX.XXX",
      "netmask": "255.255.255.255",
      "gateway": "XXX.XXX.XXX.XXX",
      "mac": "02:00:00:XX:XX:XX"
    },
    {
      "nic_tag": "perso0",
      "model": "virtio",
      "ip": "192.168.50.1",
      "netmask": "255.255.255.0",
      "allow_ip_spoofing": "1",
      "gateway": "192.168.50.1"
    }
  ],
  "disks": [
    {
      "boot": true,
      "model": "virtio",
      "size": 10240
    }
  ],
  "customer_metadata": {
    "root_authorized_keys":
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDPh6rXkj2wvvl7ih/W2KKF336okSb+CVYf3iWEUDWZ7s+EvCkyw9WZff5agq4YKiriAHshXOvvdFx96bFCV8Q6uovqUtqL24P4GN6QYn/0WAhEz/EiLvN1Ig//S8CepWVggnqYkn0oRJzFxUJJ6qx2Vna724V3bwerAF5PzDLnjqjLzxwMQOf39a3h0nurBEZ59bLOa0LFhX5XmuTo1qgkZW0zuX8UHwLHEnZ1+9s4eaBL3Kd78R3MA+pE4k15KFOXiByOX72SZ2tYcMLdShLyRaeuuy/Kmn9rqXFDnOKQ6F6zPmSLlaqJa+Kh1wBtY9vsOCVW1KIBafqG90JfSJO1 yubikey"
  }
}

Créer la vm et récupérer son id.

vmadm create -f openbsd.json
Successfully created VM 4a9ec9c5-561c-4d65-b54a-26a9756dbe92
export openbsd="4a9ec9c5-561c-4d65-b54a-26a9756dbe92"

Copier l’iso d’install et démarrer la vm.

cp cd56.iso /zones/4a9ec9c5-561c-4d65-b54a-26a9756dbe92/root/
vmadm boot $openbsd order=cd,once=d cdrom=/cd56.iso,ide
Successfully started VM 4a9ec9c5-561c-4d65-b54a-26a9756dbe92

Récupérer les informations pour la connexion vnc.

vmadm info 4a9ec9c5-561c-4d65-b54a-26a9756dbe92

  "vnc": {
    "host": "XXX.XXX.XXX.XXX",
    "port": 12345,
    "display": 52850
  },