~hww3/oi-vm-tools

SmartOS integration for OpenIndiana and OmniOS guests
add helper script
fix root password setting
add ssh, update node version for tribblex m23

refs

master
browse  log 

clone

read-only
https://git.sr.ht/~hww3/oi-vm-tools
read/write
git@git.sr.ht:~hww3/oi-vm-tools

You can also use your local clone with git send-email.

This repository provides instructions for integration of OpenIndiana (and likely OmniOS) guests within a SmartOS or Triton host.

Features include:

  • vm with both MBR and EFI boot support for use with KVM or bhyve
  • serial console for use with vmadm console
  • preparation of a basically blank system for use as a smartos hvm image
  • machine setup from triton/vmadm configuration:
    • network interface naming and configuration
    • configuration of root password on initial boot
    • synchronization of authorized keys on each startup
    • user and operator script support
    • configuration of secondary zfs pool on second disk

The code in this repository is extended or modified for this purpose from the following Joyent repositories:

smartos-live (net-physical, net-routing-setup and mdata services) sdc-vmtools (smartdc setup scripts, etc)

Limitations:

  1. Certain tasks are only performed on the first startup following the installation. For example: root password setting. Individual sub-scripts can be run manually from /lib/smartdc.
  2. ZFS pool autoextension seems to cause the intial boot to hang and thus isn't enabled. Further investigation may provide a solution to this behavior.

Usage:

  1. Clone this repository on an existing OI system and download and prepare the prerequisites listed below. Tar the resulting oi-vm-tools directory.
  2. Create a blank vm and install OpenIndiana Hipster. Install the OS across the full disk using GPT partitioning (the default as of 20191105). Do not configure networking or a root password.
  3. Reboot the system.
  4. Log in as root and disable history:
    • set +o history
  5. Set up a temporary network interface:
    • svcadm disable network/physical:nwam
    • svcadm enable network/physical:default
    • ipadm create-if -t vioif0
    • ipadm create-addr -t -T dhcp vioif0/v4
  6. Copy the prepared oi-vm-tools archive to the system:
    • scp user@somehost:oi-vm-tools.tar.gz /var/tmp
    • cd /var/tmp && tar xzvf oi-vm-tools.tar.gz
  7. Run the install script
    • cd oi-vm-tools
    • sh install.sh
  8. If all is successful, shut down the system and (optionally) create an image.
    • poweroff

Other components required:

changepass, written by Staf Wagemakers: Download and untar into the oi-vm-tools directory http://www.wagemakers.be/uploads/78/ab/78ab14305dd9fa3c42840aa2e64127bb/changepass_sol10_x86.tar.gz mdata-client, from Joyent: Clone into the oi-vm-tools directory, then build the project. git clone https://github.com/joyent/mdata-client json utility, by Trent Mick Clone into the oi-vm-tools directory. git clone https://github.com/trentm/json

Notes for creating an image from scratch:

As of 01/2020, the OI Hipster installer will not boot on a bhyve vm.

  1. Create a blank kvm instance:

    create blank_vm.json:

{ "brand": "kvm", "alias": "install-kvm", "vcpus": 1, "autoboot": false, "ram": 4096, "disks": [ { "boot": true, "model": "virtio", "size": 10240 } ], "nics": [ { "nic_tag": "admin", "ip": "dhcp", "primary": "true", "model": "virtio" } ] }

 vmadm create -f blank_vm.json
  1. Note the UUID of the resulting VM. Copy the OI Hipster text install iso to the root of the new VM:

    cp OI-hipster-text-20191106.iso /zones/UUID/root

  2. Start the vm:

    vmadm start UUID order=cd,once=d cdrom=/OI-hipster-text-20191106.iso,ide

  3. Connect to the VNC console:

    vmadm info UUID | json vnc

  4. Install OI and configure vm-tools per instructions above.

  5. With VM shut down, create a snapshot and export its contents: (Note that KVM instances have a different disk layout than bhyve)

    zfs snap zones/UUID-disk0@snap zfs send zones/UUID-disk0@snap | gzip - > /zones/oi-hipster-image.zfs.gz

  6. Create a manifest file (sample starting point included in this repo)

    vi /zones/oi-hipster-image.json

  7. Import the resulting manifest and image file using imgadm:

    imgadm install -m /zones/oi-hipster-image.json -f /zones/oi-hipster-image.zfs.gz

Do not follow this link