Skip to main content

Enable Internal Fabric

Internal Fabric is a separate network between the cluster nodes. Over it, a virtual machine (VM) that runs outside the node of its pool gets its disks from that node over NVMe/TCP — a protocol for accessing NVMe disks over a regular network; the SPDK service of the pool node serves them. Until the fabric is enabled, VMs are started only on the node of their pool. After it is enabled, Center starts VMs on any node of the cluster, and the web interface shows the Start at node button — a start on the node that you select. How a VM works on another node — VM on another node.

This page is for a cluster that moved to 3.2 from vStack OS 3.0 or 3.1: VM disk access over the network is not enabled on it. Enable it when all nodes are on 3.2.4, 3.2.5 or 3.2.6 and Center is 3.2.0. If the nodes are still on 3.0, 3.1 or 3.2.0, the fabric is enabled as part of the same work as the move to 3.2 — Choose a path to 3.2.

On a cluster installed on 3.2, VM disk access over the network is enabled at installation — the steps on this page are not required.

Until the fabric is enabled

Until step 9, do not start VMs from the web interface: Start can choose a node other than the node of the VM pool, and there is no Start at node button until the fabric is enabled. Start VMs with the vms-start API method with the node_id parameter — the Center ID of the node where the VM pool is currently open — API reference.

Before you begin​

  • All nodes run vStack OS 3.2.4, 3.2.5 or 3.2.6, Center is 3.2.0. Step 1 checks this.
  • Network engineers have provided the fabric network — fabric network requirements.
  • You have SSH access as root to all nodes and to the management VM, and access to the BMC console of each node.
  • You have a Center account with the Cluster master role: it can transfer pools and VMs when a node is drained before a reboot — Drain a node before maintenance.
StageStepsWhenVM downtime
Initial cluster state, fabric network1–2in advancenone
VLAN, pool addresses, memory for SPDK3–51–3 days before the node rebootsnone
Node reboots6a separate work window, one node at a timethe VMs of each pool are interrupted twice: when the pool is transferred off the node and back
Enabling7–9right after step 6none
Verification10right after enablingone test VM
SPDK memory11after 2–3 days of operationnone

Fabric network​

Network engineers provide the fabric network:

  • a /24 subnet that contains nothing but the cluster nodes;
  • its own VLAN, for example 1005, — the tag is allowed on the switch ports where lagg20 of the nodes is connected. On a node with one aggregate (no lagg20), the tag is on the lagg10 ports: its own, not the VLAN of the isolated networks segment (VXLAN) and not the VLAN of the public access network;
  • MTU 9216 on the switch ports and on the port-channel; on the node — MTU 9000 on the aggregate and on the fabric VLAN (step 3).

The fabric network stays inside the cluster: it needs only L2 between the nodes, with no gateway and no outside access.

How to read the steps​

  • Where — which machine to run the step on:
    • workstation — your computer with sh, ssh, scp and jq. Run the commands in sh or bash, not in zsh, and from one directory: the files of steps 4 and 9 stay in it. An ssh root@<node> 'sh -s' <<'EOF' … EOF block is started on the workstation and runs on the node;
    • management VM — the management VM over SSH; Center runs in it;
    • node — the node over SSH. After you sign in to the node, first run sh.
  • A comment after # is what the command must print.
  • Expected result — the result if everything is fine.
  • If not — what to do. Stop — do not perform the next steps: write down the step number and the output and contact vStack technical support — Collect data for support. If the result is different and the step has no "If not" part, stop too.
NotationWhat it is
<node>the management address of the node that you use to connect over SSH
<N>the node number in the cluster — Node ID in the vstack-cluster status output
zNNa pool; NN is its number: z01, z02 …
<MGMT>the address of the management VM in the public access network
<fabric>the first three octets of the fabric subnet, for example 192.0.2
<tag>the VLAN number of the fabric
<fabric_if>the fabric interface on the nodes — vlan<tag>, the same on all nodes (step 3)
NODESa workstation variable: the management addresses of all nodes separated by spaces (step 2)
<buffers>memory for SPDK on the node, in gigabytes (step 5)

1. Determine the initial state of the cluster​

  • Where: the management VM; each node; the workstation.

On the management VM — the Center settings file, the fabric flag, the fabric addresses of the pools in Center and the Center version:

test -f /usr/local/etc/vstack/settings.yml && echo settings-OK # Center settings file
cd /tmp
su -m postgres -c "psql -At -d vstack -c \"select value from management.cluster_options where an_option = 'feature.nvmf'\"" # fabric flag
su -m postgres -c "psql -At -d vstack -c 'select name, nvmf_inet from storage.pool order by name'" # fabric addresses of the pools in Center
pkg query '%v' vstack-center-dispatcher # Center dispatcher version

On each node — the version, the SPDK packages, the NVMe-oF target and the isolated networks segment (VXLAN):

freebsd-version -k # 14.2-RELEASE-vstack-3.2.4-…, 3.2.5-… or 3.2.6-…
pkg info -e vStack-spdk vStack-nvmf-initiator && echo spdk-OK # SPDK packages
grep -E '^(nvmf_tgt|spdk_tgt)_' /etc/rc.conf.local # enabled NVMe-oF targets
pgrep -lf '^/usr/local/bin/(spdk|nvmf)_tgt' # running NVMe-oF targets
grep vxlan_vlan /usr/local/etc/vstack-env.conf # VXLAN network and interface
ifconfig | grep -o 'vxlan vni [0-9]* local [0-9.]*' | head -1 # node address in the VXLAN network, if the lines above are empty

The NVMe-oF target — the node service that serves VM disks to other nodes — is spdk_tgt. If the previous nvmf_tgt target is enabled or running on the node instead, it is switched to spdk_tgt in step 6.1.

On the workstation — the fabric addresses of the pools in the cluster manager configuration (pool, interface, address), from any node:

ssh root@<node> cat /usr/local/etc/ccrd/config.json | jq -r '.services[] | select(.name|test("^zpool_z")) | .name as $n | .ext_ips[]? | select(.label=="NVMf") | "\($n) \(.interface) \(.ip)"'

The Center version — by the dispatcher version:

vstack-center-dispatcherWhat to do
0.0.96 — Center 3.2.0do not update Center; continue with the table below
from 0.0.47 to 0.0.95first update Center to 3.2.0 following Move to 3.2 with Center 3.0.3–3.2.0: preparation steps 2, 4, 8 and 9, then window B — the Center update work
another version or no packagestop

Determine the Center version by the vstack-center-dispatcher package, not by vstack-center: different Center releases can have the same vstack-center package version.

Expected result and what to do:

What you seeWhat to do
no settings-OK, or a node is not on 3.2.4, 3.2.5 or 3.2.6upgrade the cluster first — Choose a path to 3.2
the node is on 3.2.4, 3.2.5 or 3.2.6, but there is no spdk-OKinstall the missing components of the 3.2 line — Upgrade a 3.0, 3.1 or 3.2.0 node to 3.2.6, step 8a
the node has nvmf_tgt_… lines or nvmf_tgt is runningswitch the target on this node in step 6.1
feature.nvmf is empty or 0run steps 2–11 in order; step 4 replaces the NVMf lines in the cluster manager configuration, if there are any
feature.nvmf = 1, the pool addresses are in the VXLAN network (vxlan_vlan_network) or on its interfaceaccess is already enabled — the steps on this page are not required
feature.nvmf = 1, the pool addresses are in their own fabric networkdo nothing; check how the fabric works with steps 10 and 11

2. Get the fabric network and prepare the workstation​

  • Where: network engineers; the workstation.
  1. Get the network from the network engineers — according to the requirements. Write down <fabric> and <tag>.

  2. On the workstation, set the management addresses of all nodes — you need them in steps 4 and 9:

    export NODES="<node 1 address> <node 2 address> …"
  3. Make sure that no VM runs on two nodes at once — View the cluster state on a node, the "Find where the VM actually runs" stage.

Expected result: the network is provided, <fabric> and <tag> are known; the number of each running VM is in /dev/vmm of exactly one node.

If not: no network — stop: do not enable the fabric without it. A VM number on two nodes — stop; do nothing with this VM.

3. Configure the fabric VLAN on the nodes​

  • Where: node, each node.

<tag> is the fabric VLAN tag, for example 1005. Addresses in the fabric network: the node with number N gets <fabric>.<100+N>, the zNN pool gets <fabric>.<200+NN>. Do not set a pool address manually: the cluster manager assigns it on the node where the pool is open, based on the entry from step 4.

If the node has no lagg20 (the node has one aggregate), write lagg10 instead of lagg20 in all commands of this step.

Check that the VLAN name and tag are free and that the aggregate MTU is at least 9000:

ifconfig -l # no vlan<tag> name in the list
ifconfig -a | grep -o 'vlan: [0-9]*' # no <tag> tag in the list
ifconfig lagg20 | grep -o 'mtu [0-9]*' # mtu 9000 or more

If the MTU is less than 9000 — stop: the node does not meet the fabric network requirements.

Set the persistent configuration:

sysrc cloned_interfaces+=" vlan<tag>"
sysrc ifconfig_vlan<tag>="inet <fabric>.<100+N>/24 vlan <tag> vlandev lagg20 mtu 9000 up"

Create and activate the VLAN now — with two commands, not in one line:

ifconfig vlan<tag> create vlan <tag> vlandev lagg20 mtu 9000
ifconfig vlan<tag> inet <fabric>.<100+N>/24 up
ifconfig vlan<tag> # UP, mtu 9000, inet <fabric>.<100+N>, parent interface: lagg20

Check connectivity — from each node to each other node M:

ping -c 2 <fabric>.<100+M> # regular packets
ping -D -s 8972 -c 2 <fabric>.<100+M> # large (jumbo) packets, without fragmentation

Expected result: vlan<tag> has UP, mtu 9000, the node address and parent interface: lagg20; both connectivity checks pass without loss between all pairs of nodes.

If not:

  • ifconfig returned an error — run ifconfig vlan<tag> destroy, fix the error and repeat both commands.
  • Regular packets do not pass — the tag is not allowed on the switch ports. Regular packets pass, but large ones do not — the MTU on the switch ports is lower than required. In both cases, contact the network engineers and do not perform the next steps.

4. Add the fabric addresses to the cluster manager configuration​

  • Where: the workstation; you edit in a text editor.

The configuration file of the ccrd cluster manager — /usr/local/etc/ccrd/config.json — is the same on all nodes: you edit it once on the workstation and copy it to all nodes. The pool address in the fabric network is an entry with the NVMf label in the pool service; the cluster manager assigns this address on the node where the pool is open.

  1. Check that the configuration file is the same on the nodes, and make a copy of it:

    for h in $NODES; do printf '%s ' $h; ssh -n root@$h 'md5 -q /usr/local/etc/ccrd/config.json'; done # the same on all nodes
    scp root@<any node>:/usr/local/etc/ccrd/config.json ccrd-config.orig.json
    cp ccrd-config.orig.json ccrd-config.new.json

    If md5 differs — stop: the configuration files on the nodes do not match; first determine the cause.

  2. In ccrd-config.new.json, each pool service ("name": "zpool_zNN") must have exactly one entry with the NVMf label in ext_ips:

    {
    "interface": "<fabric_if>",
    "ip": "<fabric>.<200+NN>",
    "label": "NVMf"
    }
    • <fabric_if> is vlan<tag> from step 3; <fabric>.<200+NN> is the pool address: z01 gets <fabric>.201, and so on.
    • There is no NVMf entry — add it as the last one in ext_ips, with a comma after the previous entry. There is one — replace interface and ip in it; do not add a second one.
    • Change nothing else: neither the other ext_ips entries, nor the cluster-management service, nor the nodes and pools sections.

    The z01 pool service before the edit:

    {
    "ext_ips": [
    {
    "interface": "vlan41",
    "ip": "<pool public access address>"
    }
    ],
    "name": "zpool_z01",
    "pools": [
    "z01"
    ]
    }

    After the edit:

    {
    "ext_ips": [
    {
    "interface": "vlan41",
    "ip": "<pool public access address>"
    },
    {
    "interface": "<fabric_if>",
    "ip": "<fabric>.201",
    "label": "NVMf"
    }
    ],
    "name": "zpool_z01",
    "pools": [
    "z01"
    ]
    }
  3. Check the edit and write the pool addresses to a file:

    diff ccrd-config.orig.json ccrd-config.new.json # only NVMf entries in the zpool_zNN services
    jq -e . ccrd-config.new.json >/dev/null && echo json-OK
    jq -r '.services[] | select(.name|test("^zpool_z")) | .name as $n | .ext_ips[] | select(.label=="NVMf") | "\($n)\t\(.interface)\t\(.ip)"' ccrd-config.new.json | tee nvmf-addresses.tsv

    nvmf-addresses.tsv has one line per pool: zpool_zNN <fabric_if> <fabric>.<200+NN>. If a pool has two lines, remove the second NVMf entry from its service.

  4. Check that the addresses are free: only addresses already assigned to pools may respond.

    cut -f3 nvmf-addresses.tsv | while read a; do ssh -n root@<any node> "ping -c 1 -t 1 $a" >/dev/null && echo "$a BUSY"; done

    If an address that was not in the original configuration is busy — stop: choose the addresses together with vStack support.

  5. Copy the configuration file to all nodes, keeping the previous one, and compare:

    for h in $NODES; do
    ssh -n root@$h 'test -e /usr/local/etc/ccrd/config.json.pre-nvmf || cp -p /usr/local/etc/ccrd/config.json /usr/local/etc/ccrd/config.json.pre-nvmf'
    scp ccrd-config.new.json root@$h:/usr/local/etc/ccrd/config.json
    done
    for h in $NODES; do printf '%s ' $h; ssh -n root@$h 'md5 -q /usr/local/etc/ccrd/config.json'; done # the same on all nodes, the new one

Do not restart ccrd: the configuration takes effect when the node reboots. Save nvmf-addresses.tsv: you need it when the pools return to the nodes and when you enable the fabric.

Expected result: diff shows only NVMf entries; json-OK; one line per pool in nvmf-addresses.tsv; no BUSY for the new addresses; md5 is the same on all nodes and differs from the original one.

If not: stop. The previous configuration file on each node is config.json.pre-nvmf.

5. Allocate memory for SPDK​

  • Where: the workstation, for each node.

SPDK is the node service that serves VM disks to other nodes. It needs memory allocated at node boot: contigmem buffers of 1 GiB each. The block below saves a copy of /boot/loader.conf.local and sets the number of buffers in it. Do not change kld_list in /etc/rc.conf.

<buffers> depends on the number of VMs per node. VMs per node is the number of VMs in the cluster divided by the number of nodes. The number of VMs in the cluster — from the Provider Data Center → All Virtual Machines list in the web interface or from the response of the vm-list API method.

VMs per node<buffers>
up to 302
up to 854
up to 2008
more than 200contact vStack technical support

The table is for VMs with two disks; if a VM has more disks, <buffers> is proportionally larger.

ssh root@<node> 'sh -s' <<'EOF'
set -e
cp -p /boot/loader.conf.local /boot/loader.conf.local.pre-contigmem-$(date +%Y%m%d%H%M%S)
sed -i '' -e '/^contigmem_load=/d' -e '/^hw.contigmem./d' /boot/loader.conf.local
cat >> /boot/loader.conf.local <<'L'
contigmem_load="YES"
hw.contigmem.num_buffers="<buffers>"
hw.contigmem.buffer_size="1073741824"
L
grep contigmem /boot/loader.conf.local
EOF

The lines take effect after the node reboots. Do not reboot the node before the reboot in step 6.

Expected result: three contigmem lines; num_buffers holds the selected number.

If not: stop.

6. Reboot the nodes one at a time​

The settings of steps 3–5 take effect only after the node reboots. If you did these steps before upgrading the nodes to 3.2, the nodes were already rebooted during the upgrade — skip this step.

Reboot the nodes one at a time. The node that runs the pool of the management VM goes last: on it, zfs list | grep '/.vm_V4/000000000$' returns non-empty output.

For each node:

  1. Drain the node: transfer its pools and running VMs to other nodes in the web interface — Drain a node before maintenance — and check the node and the cluster — Update nodes to 3.2.6, step 6. Transfer pools only with the Transfer pool action in the Hard Transfer mode. Soft transfer suspends the VMs of the pool, and on nodes before 3.2.5, suspending a pool with several VMs can cause a node failure — this is fixed in 3.2.5. A pool transfer with VM suspension — only with vStack support. vStack support transfers the pool of the management VM.
  2. Switch the node to spdk_tgt — step 6.1.
  3. Reboot the node and check it — step 6.2.
  4. Return the pools to the node — only with Hard Transfer, then the VMs — Update nodes to 3.2.6, step 12.
  5. Check the fabric addresses of the pools — step 6.3.

Proceed to the next node only after the work on the current node is complete.

Start the VMs that stayed powered off after the pool transfer only with the vms-start API method with the node_id of the node where their pool is currently open — as in the warning at the beginning of the page.

6.1. Switch the NVMe-oF target to spdk_tgt​

  • Where: node. Only on the nodes that had the nvmf_tgt_enable="YES" line in step 1. Skip the others.

The change takes effect at the reboot (step 6.2); the nvmf_tgt that is running now stops with it.

  1. Check that the settings of the two targets match:

    cmp /usr/local/etc/nvmf_tgt.json /usr/local/etc/spdk_tgt.json && echo json-same

    json-same — go to the next item. The files differ or one of them is missing — stop: the target is switched together with vStack support.

  2. See what is enabled:

    grep -E '^(nvmf_tgt|spdk_tgt)_' /etc/rc.conf.local
  3. Only nvmf_tgt is enabled, and the nvmf_tgt process was running in step 1 (there is no spdk_tgt_enable="YES" line) — enable spdk_tgt with the flags of the previous target and remove the nvmf_tgt lines:

    sysrc -f /etc/rc.conf.local spdk_tgt_flags="$(sysrc -f /etc/rc.conf.local -n nvmf_tgt_flags)"
    sysrc -f /etc/rc.conf.local spdk_tgt_enable=YES
    sysrc -f /etc/rc.conf.local -x nvmf_tgt_enable nvmf_tgt_flags

    There is an nvmf_tgt_rpc_addr line — move it too:

    sysrc -f /etc/rc.conf.local spdk_tgt_rpc_addr="$(sysrc -f /etc/rc.conf.local -n nvmf_tgt_rpc_addr)"
    sysrc -f /etc/rc.conf.local -x nvmf_tgt_rpc_addr

    Only nvmf_tgt is enabled, but there was no process, or both are enabled — remove the nvmf_tgt lines; do not change spdk_tgt:

    sysrc -f /etc/rc.conf.local -x nvmf_tgt_enable nvmf_tgt_flags

    There is an nvmf_tgt_rpc_addr line — remove it too: sysrc -f /etc/rc.conf.local -x nvmf_tgt_rpc_addr.

    The sysrc: unknown variable 'nvmf_tgt_flags' response means that there was no such line; the other lines are removed.

  4. Check:

    grep -E '^(nvmf_tgt|spdk_tgt)_' /etc/rc.conf.local

Expected result: there are no nvmf_tgt_… lines. If nvmf_tgt was running or both targets were enabled — there are spdk_tgt_enable="YES" and spdk_tgt_flags. If it was not running — there are no spdk_tgt_… lines either.

If not: stop.

6.2. Reboot the node and check it​

  • Where: node; keep the BMC console of the node open.

Reboot only a drained node — item 1 of step 6.

sync; shutdown -r now

After boot:

sysctl -n kern.bootfile # /boot/kernel.GENERIC_PROD/kernel
sysctl hw.contigmem.num_buffers # <buffers> from step 5
ifconfig <fabric_if> | grep 'inet ' # <fabric>.<100+N>
pgrep -lf '^/usr/local/bin/(spdk|nvmf)_tgt' # NVMe-oF targets

Expected result: the path has no _prev; num_buffers is the chosen number; the node address in the fabric network is assigned; there is no nvmf_tgt in the pgrep output.

If not:

  • num_buffers is empty or 0, or there is no node address — stop; do not return the node to service.
  • The kern.bootfile path has _prev — stop: the node booted the previous kernel — Update nodes to 3.2.6, "Troubleshooting".
  • The pgrep output has nvmf_tgt or both targets — stop.

6.3. Check the fabric addresses of the pools​

  • Where: node, after the pools have returned to it.
ifconfig <fabric_if> | grep 'inet ' # one <fabric>.<200+NN> address for each pool of the node

The pool addresses are in nvmf-addresses.tsv from step 4.

Expected result: each pool of this node has its address in the fabric network assigned.

If not: the fabric address of a pool is not assigned — stop.

7. Enable the fabric in the Center settings​

  • Where: the management VM.

The nodes role — a set of Center tasks for Ansible — configures the nodes. With the parameters below, it enables the NVMe-oF services on the nodes.

  1. Save a copy of the settings:

    cp -p /usr/local/etc/vstack/settings.yml /root/settings.yml.pre-nvmf
  2. In /usr/local/etc/vstack/settings.yml, set two parameters: vstack_node_install_nvmf: true and nvmf_net: "<fabric>.0/24" — the fabric subnet, as in step 3.

  3. Run the role with --check: this way, it only shows what it would change and changes nothing.

    cd /usr/local/share/vstack-center
    umask 077
    ANSIBLE_CONFIG=$PWD/ansible.cfg ansible-playbook main.yml -t nodes -e @/usr/local/etc/vstack/settings.yml --check --diff > /var/log/nodes-check.log 2>&1; echo rc=$?
    sed -n '/PLAY RECAP/,$p' /var/log/nodes-check.log
    grep -E '^[-+](Password|password)' /var/log/nodes-check.log | wc -l # 0

    If the process does not finish for a long time after the PLAY RECAP line, interrupt it — Ctrl+C.

    Expected result: each node has unreachable=0 failed=0, and the Enable NVMe-oF services task changes. If the Center 3.2.0 role has not been run on the nodes yet, the perl collectors, vmagent and check_idle also change — up to 11 changed per node.

    If not: the output contains nvmf_tgt, or network interfaces, the cluster manager configuration or passwords change — stop.

  4. Run the role in the background:

    cat > /root/nodes-run.sh <<'X'
    #!/bin/sh
    umask 077
    cd /usr/local/share/vstack-center
    ANSIBLE_CONFIG=$PWD/ansible.cfg ansible-playbook main.yml -t nodes -e @/usr/local/etc/vstack/settings.yml --diff > /var/log/nodes-run.log 2>&1
    echo "rc=$?" >> /var/log/nodes-run.log
    X
    daemon -f sh /root/nodes-run.sh
  5. When the rc=… line appears at the end of /var/log/nodes-run.log, view the result:

    sed -n '/PLAY RECAP/,$p' /var/log/nodes-run.log

Expected result: each node has unreachable=0 failed=0.

On the nodes where spdk_tgt is already enabled — for example, after the switch in step 6.1 — the Enable NVMe-oF services task can show changed=0: the services there are already enabled with the same flags. This is expected; continue the work.

8. Start SPDK on the nodes​

  • Where: the workstation, for each node.

The block starts the spdk_tgt target and the vstack_nvmf_initiator NVMe-oF initiator on the node if they are not running yet, and shows their processes and the target listener.

ssh root@<node> 'sh -s' <<'EOF'
grep -q '^nvmf_tgt_' /etc/rc.conf.local && { echo "STOP: nvmf_tgt lines in rc.conf.local"; exit 1; }
pgrep -qf '^/usr/local/bin/nvmf_tgt' && { echo "STOP: nvmf_tgt"; exit 1; }
pgrep -qf '^/usr/local/bin/spdk_tgt' || { nohup service spdk_tgt start >/dev/null 2>&1 </dev/null & }
sleep 8
pgrep -qf vstack-nvmf-initiator || { nohup service vstack_nvmf_initiator start >/dev/null 2>&1 </dev/null & }
sleep 5
pgrep -lf '^/usr/local/bin/spdk_tgt|nvmf-initiator'
sockstat -4l | grep spdk_tgt
EOF

Expected result: both processes, the *:7000 listener.

If not: STOP: nvmf_tgt or STOP: nvmf_tgt lines — stop; continue together with vStack support. There is no spdk_tgt process — the reason is in /var/log/spdk_tgt.log; stop.

9. Add the pool addresses to Center​

  • Where: the workstation; the management VM.
  1. On the workstation, check that the address of each pool is assigned on the node where the pool is currently open:

    for h in $NODES; do ssh -n root@$h 'ifconfig <fabric_if>'; done | grep -c "inet <fabric>\.2" # = the number of pools
  2. On the workstation, build the SQL with the addresses from step 4 and copy it to the management VM:

    V=$(awk -F'\t' '{sub("zpool_","",$1); printf "%s(\x27%s\x27,\x27%s\x27)", (NR>1?", ":""), $1, $3}' nvmf-addresses.tsv)
    cat > nvmf-enable.sql <<SQL
    \\set ON_ERROR_STOP 1
    BEGIN;
    CREATE TEMP TABLE want(name text PRIMARY KEY, inet inet UNIQUE);
    INSERT INTO want VALUES $V;
    DO \$\$ BEGIN
    IF (SELECT count(*) FROM storage.pool) <> (SELECT count(*) FROM want)
    OR EXISTS (SELECT 1 FROM storage.pool p LEFT JOIN want w USING (name) WHERE w.name IS NULL)
    THEN RAISE EXCEPTION 'pool list does not match storage.pool'; END IF;
    END \$\$;
    UPDATE storage.pool p SET nvmf_inet = w.inet FROM want w WHERE w.name = p.name;
    INSERT INTO management.cluster_options (an_option, value) VALUES ('feature.nvmf','1')
    ON CONFLICT (an_option) DO UPDATE SET value = EXCLUDED.value;
    SELECT name, nvmf_inet, current_node FROM storage.pool ORDER BY name;
    COMMIT;
    SQL
    grep 'INSERT INTO want' nvmf-enable.sql
    scp nvmf-enable.sql root@<MGMT>:/root/
  3. On the management VM, save the previous pool addresses, run the SQL and restart the Center dispatcher:

    cd /tmp
    su -m postgres -c "psql -X -At -d vstack -c \"copy (select name, nvmf_inet from storage.pool order by name) to stdout\"" > /root/pool-nvmf-pre.tsv
    rc=0; su -m postgres -c "psql -X -v ON_ERROR_STOP=1 -d vstack" < /root/nvmf-enable.sql || rc=$?
    echo rc=$rc
    [ $rc = 0 ] && service vstack_center_dispatcher restart

    You need the /root/pool-nvmf-pre.tsv file with the previous addresses for a rollback.

Expected result: rc=0, each pool has its own address. From now on, Center starts VMs on any node, and the web interface has the Start at node button.

If not: the pool list does not match storage.pool error — the transaction was rolled back, nothing was changed: compare nvmf-addresses.tsv with the cluster pools.

10. Check the fabric on a Linux VM​

  • Where: the Center web interface; node.

Check on a Linux VM that you can stop for a short time. Start Windows VMs on another node only after you contact vStack technical support.

  1. Open the VM page. Next to the Node field, there must be Locally: the VM runs on the node of its pool.

  2. Stop the VM — Start, stop and restart a VM.

  3. Click Start at node and select any node except the one where the VM pool is open.

  4. Wait for the Started status. Next to the Node field — Remotely.

  5. On the selected node, view the connections to the pool address:

    sockstat -4 -c | grep ':4420' # connections to <fabric>.<200+NN>:4420 — the address of the VM pool
  6. Open the VM console and make sure that the guest OS has booted — Open the VM console.

  7. Stop the VM and start it with the Start at node button on the node of its pool. Next to the Node field, there is Locally again.

Expected result: the VM started on another node, Remotely is shown, there are connections to the pool address on port 4420, and the guest OS booted; after the return, the VM is again on the node of its pool.

If not: roll back.

11. After 2–3 days, check the SPDK memory​

  • Where: node — the current node of the pool to which the most VMs from other nodes are connected. How to find the VMs of a pool on other nodes — VM on another node.
printf '%s' '{"jsonrpc":"2.0","id":1,"method":"env_dpdk_get_mem_stats"}' | nc -N 127.0.0.1 7000 >/dev/null
grep -E 'Heap_size|Alloc_size' /tmp/spdk_mem_dump.txt | grep -v ':0,'

Alloc_size is how much SPDK memory is in use, Heap_size is how much was allocated in step 5.

Expected result: no more than two thirds of the allocated memory is in use.

If not: increase <buffers> on the nodes, as in step 5. The new value takes effect at the next node reboot; reboot a drained node, as in step 6.

Rollback​

  1. Return all VMs to the nodes of their pools. Find the VMs that run outside the node of their pool — VM on another node, "What you see". Stop each of them and start it with the Start at node button on the current node of its pool.

  2. On the management VM, restore the pool addresses and the fabric flag as they were before step 9:

    cd /tmp
    { cat <<'SQL'
    \set ON_ERROR_STOP 1
    BEGIN;
    CREATE TEMP TABLE was(name text PRIMARY KEY, inet inet);
    COPY was FROM STDIN;
    SQL
    cat /root/pool-nvmf-pre.tsv; echo '\.'
    cat <<'SQL'
    UPDATE storage.pool p SET nvmf_inet = w.inet FROM was w WHERE w.name = p.name;
    UPDATE management.cluster_options SET value = '0' WHERE an_option = 'feature.nvmf';
    COMMIT;
    SQL
    } > /root/nvmf-rollback.sql
    rc=0; su -m postgres -c "psql -X -v ON_ERROR_STOP=1 -d vstack" < /root/nvmf-rollback.sql || rc=$?
    echo rc=$rc
    [ $rc = 0 ] && service vstack_center_dispatcher restart
  3. On the management VM, restore the Center settings. Do not run the nodes role after that.

    cp -p /root/settings.yml.pre-nvmf /usr/local/etc/vstack/settings.yml
  4. On each node, disable the NVMe-oF services:

    sysrc -f /etc/rc.conf.local spdk_tgt_enable=NO vstack_nvmf_initiator_enable=NO
    service spdk_tgt stop
    service vstack_nvmf_initiator stop
  5. On each node, restore the memory for SPDK and the pool addresses in the cluster manager configuration:

    ls /boot/loader.conf.local.pre-contigmem-* # copies with memory for SPDK; you need the earliest one
    diff /boot/loader.conf.local.pre-contigmem-<time> /boot/loader.conf.local # only the contigmem lines differ
    cp -p /boot/loader.conf.local.pre-contigmem-<time> /boot/loader.conf.local
    cp -p /usr/local/etc/ccrd/config.json.pre-nvmf /usr/local/etc/ccrd/config.json
    md5 -q /usr/local/etc/ccrd/config.json # the same on all nodes

    This takes effect when the nodes reboot — one at a time, as in step 6. Until then, the memory for SPDK stays allocated.

After the rollback, start VMs again only on the node of their pool — with the vms-start API method with node_id, as in the warning at the beginning of the page. Warn the VM users.

What not to do​

  • Do not start VMs from the web interface before step 9 — only with the vms-start API method with the node_id of the node of their pool.
  • Do not restart ccrd after editing its configuration: the configuration takes effect when the node reboots.
  • Do not reboot nodes between steps 3 and 6 outside the plan: reboot only a drained node, one at a time.
  • Do not set pool addresses on the fabric interface manually: the cluster manager assigns them.
  • Do not proceed to the next node until the work on the current node is complete.
  • Do not change kld_list in /etc/rc.conf.
  • Do not run the nodes role after a rollback.

Next​

API methods: vms-start, vms-stop, vm-list — in the API reference.