How to Prepare VM for Testing in SPB Labs (UEFI)
Step1. VM Settings
The virtual machine with the following parameters is required for testing purposes:
4 CPUs
8Gb memory
30Gb hdd (and 3x8Gb for zfs tests)
In SPB Labs you can access VMs here.
2. You can select a free IP address for your VM on this page - https://dilos-dev.atlassian.net/wiki/spaces/AL/pages/1936326753, for example:
As you see, on this page addresses 127 and 138 are free. They will look like this: 10.20.50.127 and 10.20.50.138 respectively. Store this address and write your machine name on the right of the address.
3. On the vSphere page open the menu of you machine and change it’s settings (Edit Settings… item):
Select please an ISO-file (the Datastore ISO file menu item) to install DilOS:
Select version with UEFI support you would like to set as a base version - for example, the last one:
Set the Connected At Power On checkbox to connect ISO-file automatically on power on:
As you see ISO-file emulates CD-ROM on VM, and you need to boot from CD-ROM. To do this the BIOS screen should be loaded first on power on. In the Firmware select please EFI. To emulate running of EFI you have to select the During the next boot, force entry into the setup screen checkbox on the VM Options page in Boot Options :
Step 2. Run VM
Run your VM by clicking the Power | Power On menu item:
2. On start open Web Console and inside the BIOS screen select please CD-ROM Drive as the first boot device. Then save this setting and exit.
3. Then on the Boot Manager page select (using +/- for moving up/down) EFI Vmware Virtual IDE CDROM Drive item and press ENTER.
Step 3. DilOS Installation
After booting from the selected ISO-file the GRUB menu is opened. Select please the Boot Multi User item and press Enter
Then follow the instruction on the screen - login as root with 123 password.
The DilOS installer is running by the screen command:
screen
Then follow the instructions on the screen. The system detects available network links, choose a number of link that you want to use as the primary interface of the system and hit Enter/Return key
Select the static method Using static IPv4:
and enter the IP-address that has been taken on Step 1 item 2 (for example, 10.20.50.117), a netmask 255.255.255.0 and the gateway address (in SPB Labs it is 10.20.50.199) and confirm your settings. You can change everything later if you’d like.
In some cases (on a big storage platforms, for example) we need to change MTU (Maximum Transmission Unit), in this screen you can do it. But don't change it if you don't know what you are doing! Just skip this step.
Now you should setup a password for the root user.
Root is the system administrator, this user can do everything, install/update/remove packages, edit configuration files and many other actions. Be careful using this account and don't forget the password!
Don't worry if you mistyped, the system will ask you again. Now create your own account (for example, og). You can work with it under ssh as well - enter your login and password please:
Now choose a node (host) name. Enter it if you need something special (it can make a little bit easier you work with tests further if you put the same name as a name of the machine in vSphere), otherwise leave it as is by pressing Enter and confirm your choice:
You can now enter any domain name if you plan to connect your VM to any domain. Otherwise leave it as is just by pressing Enter:
The nameserver address in SPB Labs is 8.8.8.8 and the second one is 8.8.4.4. These addresses will be used by default, so you can just leave them as is. The Search list can be empty as well. You can change it later if needed.
Then the installer detects of connected storage devices (hard drives). The list can be very long or it can have the only device. Just choose a device where you want to to install the system to. For 4-HDDs configuration (for zfs tests) select the biggest device.
Then select please the UEFI boot method:
Confirm you settings finally:
Then installation process goes on. It may take a time. During the process you will see many logs. And on the final screen just Enter for reboot.
Step 4. Booting of Just Installed System.
After reboot the newly installed system will be loaded by default.
After this you will be able to login to your VM not only by Web Console, but via SSH with your account that has been created on installation (in our example it is og).
Step 5. Apt Settings, BEs Creation and Open VM Tools Installation
All other actions require a root access. So, login under the root account:
su -
Now you have to create a backup BE with an image of the already installed system to use as a system source, in other words you will be able to skip all steps of this instruction from the beginning to the current point:
beadm create dilos_ISO_orig
Then update apt settings:
apt update
After this the system is ready to install Open VM Tools. Login as root and enter please the command:
apt install open-vm-tools
Run Open VM Tools after successful installation:
svcadm enable open-vm-tools
Reboot VM:
reboot
You should see your IP addresses in vSphere for your VM if everything is OK.
Note : While there is no any new tested stable version, you can use this BE as a base BE. In other words you can skip all steps from the beginning of this instruction to the current point. To do this execute the following command like you did it for dilos_ISO_orig:
beadm create dilos_BASE
When you later will boot from this BE type the following commands:
beadm activate dilos_BASE
reboot
Step 6. Prepare VM for Tests Running
Prepare your VM for tests running (again all commands should be run under the root account). To login as root you can use su
command:
og@dilos:~# su -
Install a DilOS version that you plan to test. To do this please put repositories addresses for apt like you did it before. Put the following rules to the
/etc/apt/sources.list
file for RELEASE versions:
deb http://10.20.50.188/dilos dilos2 main contrib non-free
You can do it with any text editor or by executing the following command:
cat > /etc/apt/sources.list <<EOT
deb http://10.20.50.188/dilos dilos2 main contrib non-free
EOT
For DEBUG versions they are:
deb http://10.20.50.188/dilos dgdbg-unstable main contrib non-free
deb http://10.20.50.188/dilos du2-unstable main contrib non-free
or:
cat > /etc/apt/sources.list <<EOT
deb http://10.20.50.188/dilos dgdbg-unstable main contrib non-free
deb http://10.20.50.188/dilos du2-unstable main contrib non-free
EOT
Then run system upgrade:
apt update
os-upgrade -r
After reboot login again under the root account.
If the test version is not loaded by any reason you can see its file like it is described here.
Note : Here you can install packages required for specified test categories if you’d like. Package names are specified inside an instruction for those test category (LIBC, NET, OS etc.). But however you can do it later.
Check that upgrade was successful by entering the following command:
grep -e 'WARNING:' -e 'warning:' -e 'W:' -e 'error:' -e 'E:' -e 'cannot' /var/tmp/os-upgrade.log | sort -u
2. Now you can use a script or do the following steps. Create user ztest:
root@dilos:~# useradd -m -d /var/ztest -g staff -s /bin/bash ztest
root@dilos:~# passwd ztest
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
root@dilos:~# echo "ztest ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers.d/ztest
3. Configure NAT according the How to configure NET on Virtual Machine for global zone with etherstub instruction until zone creation.
Step 7. Test Zones Creation
For steps 1-3 you can run the script or do steps 1-3 with checks.
Create the mountpoint to mount all zones:
root@dilos:~# zfs create -o mountpoint=/zones rpool/zones
root@dilos:~# mkdir /export/builds
2. First create and run dhcp zone:
root@dilos:~# cat > dhcp.cmd <<EOT
create -b
set zonepath=/zones/dhcp
set brand=dpkg
set autoboot=true
set ip-type=exclusive
add fs
set dir="/export/builds"
set special="/export/builds"
set type="lofs"
end
add net
set physical="iz1"
set global-nic="vsw0"
add property (name=ip,value="192.168.0.1")
add property (name=netmask,value="255.255.255.0")
add property (name=gateway,value="192.168.0.254")
add property (name=primary,value="true")
end
add attr
set name="resolvers"
set type="string"
set value="8.8.8.8"
end
verify
commit
EOT
root@dilos:~# zonecfg -z dhcp -f dhcp.cmd
root@dilos:~# zonecfg -z dhcp info
zonename: dhcp
zonepath: /zones/dhcp
brand: dpkg
autoboot: true
bootargs:
pool:
limitpriv:
scheduling-class:
ip-type: exclusive
hostid:
fs-allowed:
uuid: 46b79185-7320-4ab6-b700-15058bd49c02
fs:
dir: /export/builds
special: /export/builds
raw not specified
type: lofs
options: []
net:
address not specified
allowed-address not specified
defrouter not specified
global-nic: vsw0
mac-addr not specified
physical: iz1
vlan-id not specified
property: (name=ip,value="192.168.0.1")
property: (name=netmask,value="255.255.255.0")
property: (name=gateway,value="192.168.0.254")
property: (name=primary,value="true")
attr:
name: resolvers
type: string
value: 8.8.8.8
root@dilos:~# zoneadm -z dhcp install 2>&1 | /usr/bin/tee -a /var/tmp/dhcp-bts.log
root@dilos:~# zoneadm -z dhcp boot 2>&1 | /usr/bin/tee -a /var/tmp/dhcp-bts.log
root@dilos:~# zoneadm list -civ
ID NAME STATUS PATH BRAND IP
0 global running / dpkg shared
1 dhcp running /zones/dhcp dpkg excl
You can check that zone was installed successfully by entering the following command:
grep -e 'WARNING:' -e 'warning:' -e 'W:' -e 'error:' -e 'E:' -e 'cannot' /var/tmp/dhcp-bts.log | sort -u
3. Login to the zone, check addresses and install and run dhcp-server:
root@dilos:~# zlogin dhcp
root@dhcp:~# ifconfig
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
iz1: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 9000 index 2
inet 192.168.0.1 netmask ffffff00 broadcast 192.168.0.255
ether 2:8:20:92:59:94
lo0: flags=2002000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv6,VIRTUAL> mtu 8252 index 1
inet6 ::1/128
root@dhcp:~# apt install isc-dhcp-server -y
root@dhcp:~# mv /etc/dhcp/dhcpd.conf /etc/dhcp/dhcpd.conf.bckp
root@dhcp:~# cat > /etc/dhcp/dhcpd.conf <<EOT
# A slightly different configuration for an internal subnet.
subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.100 192.168.0.200;
option subnet-mask 255.255.255.0;
option domain-name-servers 8.8.8.8;
# option domain-name "internal.example.org";
option routers 192.168.0.254;
option broadcast-address 192.168.0.255;
default-lease-time 600;
max-lease-time 7200;
}
EOT
root@dhcp:~# ifconfig
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
iz1: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 9000 index 2
inet 192.168.0.1 netmask ffffff00 broadcast 192.168.0.255
ether 2:8:20:92:59:94
lo0: flags=2002000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv6,VIRTUAL> mtu 8252 index 1
inet6 ::1/128
root@dhcp:~# cat > /etc/default/isc-dhcp-server <<EOT
# Defaults for isc-dhcp-server (sourced by /etc/init.d/isc-dhcp-server)
# Path to dhcpd's config file (default: /etc/dhcp/dhcpd.conf).
#DHCPDv4_CONF=/etc/dhcp/dhcpd.conf
#DHCPDv6_CONF=/etc/dhcp/dhcpd6.conf
# Path to dhcpd's PID file (default: /var/run/dhcpd.pid).
#DHCPDv4_PID=/var/run/dhcpd.pid
#DHCPDv6_PID=/var/run/dhcpd6.pid
# Additional options to start dhcpd with.
# Don't use options -cf or -pf here; use DHCPD_CONF/ DHCPD_PID instead
#OPTIONS=""
# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
# Separate multiple interfaces with spaces, e.g. "eth0 eth1".
INTERFACESv4="iz1"
INTERFACESv6=""
EOT
root@dhcp:~# svcadm enable isc-dhcp-server
root@dhcp:~# svcs -xv
root@dhcp:~# svcs isc-dhcp-server
STATE STIME FMRI
online 10:46:50 svc:/network/isc-dhcp-server:default
root@dhcp:~# dhcp-lease-list
To get manufacturer names please download http://standards.ieee.org/regauth/oui/oui.txt to /usr/local/etc/oui.txt
Reading leases from /var/lib/dhcp/dhcpd.leases
MAC IP hostname valid until manufacturer
===============================================================================================
root@dhcp:~# exit
logout
4. Now create the client zone if you need it (here is just an example of the client zone - most likely you need any other zone or even multiple zones):
root@dilos:~# cat > zone.cmd <<EOT
create
set zonepath=/zones/zone
set autoboot=false
set ip-type=exclusive
add net
set physical=int1
set global-nic="vsw0"
add property (name="ip",value="dhcp")
add property (name="primary",value="true")
end
commit
exit
EOT
root@dilos:~# zonecfg -z zone -f zone.cmd
root@dilos:~# zoneadm -z zone install
root@dilos:~# zoneadm -z zone boot
root@dilos:~# zoneadm list -civ
ID NAME STATUS PATH BRAND IP
0 global running / dpkg shared
1 dhcp running /zones/dhcp dpkg excl
2 zone running /zones/zone dpkg excl
root@dilos:~# zlogin -l root dhcp dhcp-lease-list
To get manufacturer names please download http://standards.ieee.org/regauth/oui/oui.txt to /usr/local/etc/oui.txt
Reading leases from /var/lib/dhcp/dhcpd.leases
MAC IP hostname valid until manufacturer
===============================================================================================
02:08:20:a0:5a:92 192.168.0.100 dhcp 2022-11-24 10:20:34 -NA-
root@dilos:~# zlogin -l root zone ifconfig
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
int1: flags=1004843<UP,BROADCAST,RUNNING,MULTICAST,DHCP,IPv4> mtu 9000 index 2
inet 192.168.0.100 netmask ffffff00 broadcast 192.168.0.255
ether 2:8:20:a0:5a:92
lo0: flags=2002000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv6,VIRTUAL> mtu 8252 index 1
inet6 ::1/128
// install pkg for os-test
root@dilos:~# uname -a
SunOS debug221122 5.11 2.0.3.7-20221122-1-0+int2 i86pc i386 i86pc
If everything is OK, your VM is ready to run tests. Enjoy!