In this section:
This section describes a procedure for installation or upgrade of an SLB SWe 1:1 HA pair on KVM using a QCOW2 image file and an ISO config drive you create using the CLI tool createConfigDrive.py
. The tool is contained within the tarball createConfigDrive-1.0.0.tar.gz
(available as part of the release software bundle). It significantly improves the workflow for the installation and upgrade of SLB SWe on KVM as compared to the traditional procedure involving an ISO file, especially when an LSWU is performed.
The procedure described in this section assumes and recommends that the active and standby instances are guests in two different KVM hosts.
For installation or upgrade of standalone instances, complete the steps for a single KVM host, rather than two hosts, and for only one instance, rather than both active and standby instances.
Before performing an installation followed by an upgrade, execute the following steps:
root
level access to the KVM hosts. For an HA pair, log on to both KVM hosts as root
(or equivalent, with full administrative privileges).Download the release software bundle and untar it. The unpacked bundle contains the tarball createConfigDrive-1.0.0.tar.gz
. C
opy it to your home directory.
# cp createConfigDrive-1.0.0.tar.gz ~/
Unpack the tarball createConfigDrive-1.0.0.tar.gz
.
# tar -xvzf createConfigDrive-1.0.0.tar.gz
Navigate to ~/createConfigDrive-1.0.0
and ensure both createConfigDrive.py
and README.md
are present. Open README.m
d in an editor such as vi to find more information on the createConfigDrive.py
tool.
# cd ~/createConfigDrive-1.0.0 # vi README.md
Ensure that the following packages that createConfigDrive.py
requires are installed on the instances:
netaddr
. If you have the Python package manager "pip
" installed, use the command "pip install netaddr
" to install the package.genisoimage
sudo apt install <dependency>
" to install the Linux packages.Copy the QCOW2 images of the base build (for initial installation) and the build to which you want to upgrade to the /var/lib/libvirt/images
directory.
# cp <path_to_qcow2_image_file> /var/lib/libvirt/images
Create copies of the base and final builds in the /var/lib/libvirt/images
directory. While executing the cp
command, add the suffix "_cp1
" and "_cp2
" to the base and final build file names respectively. For example, the names of the copied files should be similar to "sbc-V11.01.01A001-connexip-os_11.01.01-A001_126_amd64.qcow2_cp1.qcow2
" and "sbc-V11.01.01A001-connexip-os_11.01.01-A001_126_amd64.qcow2_cp2.qcow2
".
# cd /var/lib/libvirt/images # cp <base_image_file_name>.qcow2 <base_image_file_name>_cp1.qcow2 # cp <final_image_file_name>.qcow2 <final_image_file_name>_cp2.qcow2
To perform only an upgrade, skip the procedure for installation.
Log on to the KVM host reserved for the active instance as root
(or equivalent, with full administrative privileges), and execute the following steps:
Navigate to the ~/createConfigDrive-1.0.0
directory.
# cd ~/createConfigDrive-1.0.0
Run the script createConfigDrive.py
. For installation, you can run the script in either of two modes. The --cli
option provides screen prompts after which you can enter configuration data for the deployment. The --file
option requires you to pass the script a file, sbx.json
, which must contain all the required configuration data in a json file format. Both options are shown below.
The --cli
option:
Execute the following command to provide configuration data in response to prompts.
# python createConfigDrive.py --cli
Your responses determine the nature of the instance. For example, to create the active instance of an HA pair, enter values similar to the example below:
> python3 createConfigDrive.py --cli INFO:__main__:################################################################## INFO:__main__: Executing Command : createConfigDrive.py --cli INFO:__main__:################################################################## Enter the Product Type [1 - SBC , 2 - OAM]: 1 Enter the SBC HA Mode Type [1 - 1:1 , 2 - N:1]: 1 Enter the SBC Install Type [1- Standalone, 2- HA]: 2 Enter the System Name: SLBKVMHA Enter the Ce Name: SLBACTIVE Enter the Type of mgt IP[1- V4, 2- V6, 3- V4+v6]: 1 Enter the V4 mgt IP of the Active server: 10.54.221.130 Enter the V4 mgt Prefix for Active server: 24 Enter the V4 mgt GW for the Active server: 10.54.221.1 Do you want to configure second management port (mgt1) [1- Yes, 2-No ]: 2 Enter the Peer Ce Name: SLBSTANDBY Enter the Type of Peer mgt IP[1-V4, 2-V6, 3-V4+V6]: 10.54.221.131 Invalid type. Please re-enter. Enter the Type of Peer mgt IP[1-V4, 2-V6, 3-V4+V6]: 1 Enter the V4 mgt IP of the Standby server: 10.54.221.131 Enter the V4 mgt Prefix for Standby server: 24 Enter the V4 mgt GW for the Standby server: 10.54.221.1 Enter the ha IP for Active server[V4]: 169.254.99.13 Enter the ha Prefix for Active server: 16 Enter the ha IP for Standby server[V4]: 169.254.88.13 Enter the ntp IP for the server: 10.128.254.67 Enter the Timezone ID [Check README for the ID(1-595)]: 27 Enter the SBC Type[isbc,ssbc,msbc,mrfp,slb]: slb Enter the TIPC id for the system: 1569 Do you want SSH Public Key based authentication for 'admin' and 'linuxadmin' user [1- Yes, 2-No ]: 2 Do you want to enter EMS settings [1- Yes, 2-No ]: 2 Enable or Disable EMA REST module? [1- enable, 2- disable]: 2 Enable or Disable EMA Core module? [1- enable, 2- disable]: 2 Enable or Disable EMA Troubleshooting module? [1- enable, 2- disable]: 2 Do you want to enter OAM settings [1- Yes, 2-No ]: 2 Do you want to enter TSBC settings [1- Yes, 2-No ]: 2 INFO:__main__:Cleared old JSON files : Done I: -input-charset not specified, using utf-8 (detected in locale settings) Total translation table size: 0 Total rockridge attributes bytes: 411 Total directory bytes: 0 Path table size(bytes): 10 Max brk space used 0 176 extents written (0 MB) INFO:__main__:Created the active server config drive name : config_drive_slbactive.iso under output dir I: -input-charset not specified, using utf-8 (detected in locale settings) Total translation table size: 0 Total rockridge attributes bytes: 411 Total directory bytes: 0 Path table size(bytes): 10 Max brk space used 0 176 extents written (0 MB) INFO:__main__:Created the standby server config drive name : config_drive_slbstandby.iso under output dir
The --file
option:
Copy the template sbx.json
file in the ~/createConfigDrive-1.0.0/input
directory and modify it as appropriate for the deployment. The contents of the sbx.json
file are similar to the values you provide with the --cli
option. An example of a file edited for an HA pair is shown below:
{ "sbxConf": { "haMode": "1:1", "personality": "1", "installType": "1", "role": "1", "systemName": "SLBKVMHA", "ceName": "SLBACTIVE", "peerCeName": "SLBSTANDBY", "mgtIpType": "1", "mgtIp": "10.54.221.130", "mgtPrefix": "24", "mgtGw": "10.54.221.1", "mgtIpV6":"", "mgtPrefixV6":"", "mgtGwV6":"", "isMgt1Conf":"1", "mgt1IpType": "1", "mgt1Ip": "10.54.221.131", "mgt1Prefix": "24", "mgt1Gw": "10.54.221.1", "mgt1IpV6":"", "mgt1PrefixV6":"", "mgt1GwV6":"", "haIp": "169.254.99.13", "haPrefix": "16", "peerMgtIpType": "1", "peerMgtIp": "10.54.221.131", "peerMgtPrefix": "24", "peerMgtGw": "10.54.221.1", "peerMgtIpV6": "", "peerMgtPrefixV6": "", "peerMgtGwV6": "", "peerMgt1IpType": "", "peerMgt1Ip": "", "peerMgt1Prefix": "", "peerMgt1Gw": "", "peerMgt1IpV6": "", "peerMgt1PrefixV6": "", "peerMgt1GwV6": "", "peerHaIp": "169.254.88.13", "ntpIp": "10.128.254.67", "timezone": "27", "sbctype": "slb", "tipc": "1569", "rgIp":"2.2.2.2", "enableREST":"enabled", "enableCoreEMA":"enabled", "enableTS":"enabled", "haMode":"1to1" }, "emsConf": { "emsName": "", "emsPass": "", "downloadEmsConfig": "False", "emsIp1": "", "emsIp2": "", "EmsPrivateNodeParameters": { "clusterId": "" } }, "oamConf": { "oamIp1": "", "oamIp2": "" }, "extraConf": { "haFaultDetectionMode": "normal" } }
If you do not need an object for configuration, pass an empty string (""
) as its value.
For reference, the possible values of some objects are as follows:
- installType
: 1
- Standalone | 2
- HA
- mgtIpType
: 1
- IPv4 | 2
- IPv6 | 3
- IPv4 + IPv6
- timezone
: Refer to ~/createConfigDrive-1.0.0/README.md
.
- sbctype
: isbc
| ssbc
| msbc
| tsbc
| slb
| mrfp
If you want to use SSH Public Key authentication for the 'admin' and 'linuxadmin' user, edit the ~/createConfigDrive-1.0.0/conf/user-data
file to replace _ADMIN_SSH_KEY_
and _LINUXADMIN_SSH_KEY_
with their respective SSH public keys.
Execute the following command:
# python3 createConfigDrive.py --file ./input/sbx.json
The script executes and creates configuration drive images for both the active and standby instances. The file config_drive_kvm1.iso
is for the active instance, and the file config_drive_kvm2.iso
is for the standby instance. By default, the generated files are placed in the ~/createConfigDrive-1.0.0/output
directory. Copy the file
to the directory ~/createConfigDrive-1.0.0/output
/config_drive_kvm1.iso/var/lib/libvirt/images
.
# cp ~/createConfigDrive-1.0.0/output/config_drive_kvm1.iso /var/lib/libvirt/images
The recommended deployment creates the standby instance on a different KVM host. Use the scp
tool to securely copy the file to the remote location. Copy the file
to the ~/createConfigDrive-1.0.0/output
/config_drive_kvm2.iso/var/lib/libvirt/images
directory of the standby instance's host.
# scp -P 22 ~/createConfigDrive-1.0.0/output/config_drive_kvm2.iso root@<Standby_Host_IP_Address>:/var/lib/libvirt/images root@<Standby_Host_IP_Address>'s password: config_drive_kvm2.iso
Execute the following commands to change directories and then truncate the disk and create a mirror disk:
# cd /var/lib/libvirt/images # truncate --size=35G active_evlog.qcow2
Ensure the minimum disk size of both the root disk and mirror disk is 35 GB.
In the preceding command, "35G" is the size of the mirror disk in GB. Specify a size for the mirror disk that is appropriate for your system, and that does not exceed the available space on the partition.
Because the size of the disk impacts sync time, Ribbon recommends a value of 100 GB or less.
Create soft (symbolic) links for the base build that you want to install.
# ln -s /var/lib/libvirt/images/<base_image_file_name>_cp1.qcow2 /var/lib/libvirt/images/KVM1.qcow2
Execute the following command to instantiate the active instance:
# virt-install --name=SLBACTIVE \ --ram=10240 --memorybacking hugepages=yes --vcpus sockets=1,cores=2,threads=2 --cpu host-passthrough \ --disk path=/var/lib/libvirt/images/SLBACTIVE.qcow2,device=disk,bus=virtio,format=qcow2,size=50 \ --disk path=/var/lib/libvirt/images/config_drive_slbactive.iso,device=disk,bus=virtio,serial=RIBBON_CONFIG_DRIVE \ --disk path=/var/lib/libvirt/images/active_evlog.qcow2,device=disk,bus=virtio,serial=RIBBON_MIRROR_DRIVE \ --network=bridge:mgt0,model=virtio --network=bridge:ha0,model=virtio --network=bridge:pkt0-540,model=virtio \ --network=bridge:pkt1-540,model=virtio --cputune=vcpupin0.vcpu=0,vcpupin0.cpuset=2,vcpupin1.vcpu=1,vcpupin1.cpuset=10,vcpupin2.vcpu=2, vcpupin2.cpuset=3,vcpupin3.vcpu=3,vcpupin3.cpuset=11 \ --numatune=0,mode=strict --import --os-type=linux --os-variant=debianwheezy --arch=x86_64 \ --autostart --noautoconsole --vnc --virt-type kvm WARNING OS name 'debianwheezy' is deprecated, using 'debian7' instead. This alias will be removed in the future. ** (process:2114976): WARNING **: 16:42:50.405: Entity http://pcisig.com/pci/1B36/0100 referenced but not defined Starting install... Domain creation completed.
For more information on creating network bridges, refer to Creating and Linking Network Bridge.
For additional details, refer to Creating a New SBC SWe Instance on KVM Hypervisor - SRIOV.
Once the virt-install
command completes, the instance reboots twice and finally comes up in active mode. Continue with the Instantiation step for the standby instance.
Log on to the KVM host reserved for the standby instance as root
(or equivalent, with full administrative privileges), and execute the following steps:
Navigate to the /var/lib/libvirt/images/
directory.
# cd /var/lib/libvirt/images/
Execute the following command to truncate the disk and create a mirror disk:
# truncate --size=35G standby_evlog.qcow2
Ensure the minimum disk size of both the root disk and mirror disk is 35 GB.
In the preceding command, "35G" is the size of the mirror disk in GB. Specify a size for the mirror disk that is appropriate for your system, and that does not exceed the available space on the partition.
Because the size of the disk impacts sync time, Ribbon recommends a value of 100 GB or less.
Create soft (symbolic) links for the base build that you want to install.
# ln -s /var/lib/libvirt/images/<base_image_file_name>_cp1.qcow2 /var/lib/libvirt/images/KVM2.qcow2
Execute the following command to instantiate the standby instance. Note that the config drive file (config_drive_kvm2.iso
) required to instantiate the standby was also created during the "Active Instance" procedure.
# virt-install --name=SLBSTANDBY --ram=10240 --memorybacking hugepages=yes --vcpus \ sockets=1,cores=2,threads=2 --cpu host-passthrough \ --disk path=/var/lib/libvirt/images/SLBSTANDBY.qcow2,device=disk,bus=virtio,format=qcow2,size=50 \ --disk path=/var/lib/libvirt/images/config_drive_slbstandby.iso,device=disk,bus=virtio,serial=RIBBON_CONFIG_DRIVE \ --disk path=/var/lib/libvirt/images/standby_evlog.qcow2,device=disk,bus=virtio,serial=RIBBON_MIRROR_DRIVE \ --network=bridge:mgt0,model=virtio --network=bridge:ha0,model=virtio \ --network=bridge:pkt0-540,model=virtio --network=bridge:pkt1-540,model=virtio \ --cputune=vcpupin0.vcpu=0,vcpupin0.cpuset=2,vcpupin1.vcpu=1,vcpupin1.cpuset=10,vcpupin2.vcpu=2, vcpupin2.cpuset=3,vcpupin3.vcpu=3,vcpupin3.cpuset=11 \ --numatune=0,mode=strict --import --os-type=linux --os-variant=debianwheezy --arch=x86_64 --autostart \ --noautoconsole --vnc --virt-type kvm WARNING OS name 'debianwheezy' is deprecated, using 'debian7' instead. This alias will be removed in the future. ** (process:2115234): WARNING **: 16:45:43.326: Entity http://pcisig.com/pci/1B36/0100 referenced but not defined Starting install... Domain creation completed.
On completion of the execution of virt-install
command, the instance reboots twice and comes up in standby mode.
=================================================== [root@SLBACTIVE linuxadmin]# swinfo =================================================== SERVER: SLBACTIVE OS: V11.01.01-A001 EMA: V11.01.01-A001 SBC: V11.01.01-A001 SBC Type: slb HA mode: 1to1 Build Number: 126 =================================================== Installed host role: active Current host role: active =================================================== =================================================== SERVER: SLBSTANDBY OS: V11.01.01-A001 EMA: V11.01.01-A001 SBC: V11.01.01-A001 SBC Type: slb HA mode: 1to1 Build Number: 126 =================================================== Installed host role: standby Current host role: standby ===================================================