StarWind Virtual SAN: Configuration Guide for Proxmox Virtual Environment [KVM], VSAN Deployed as a Controller VM using GUI
- September 04, 2020
- 26 min read
- Download as PDF
Annotation
Relevant products
This guide applies to StarWind Virtual SAN, StarWind Virtual SAN Free (starting from version 1.2xxx – Oct. 2023).
Purpose
This document outlines how to configure a Proxmox Cluster using StarWind Virtual SAN (VSAN), with VSAN running as a Controller Virtual Machine (CVM). The guide includes steps to prepare Proxmox hosts for clustering, configure physical and virtual networking, and set up the Virtual SAN Controller Virtual Machine.
For more information about StarWind VSAN architecture and available installation options, please refer to the StarWind Virtual (vSAN) Getting Started Guide.
Audience
This technical guide is intended for storage and virtualization architects, system administrators, and partners designing virtualized environments using StarWind Virtual SAN (VSAN).
Expected result
The end result of following this guide will be a fully configured high-availability Proxmox Cluster that includes virtual machine shared storage provided by StarWind VSAN.
Prerequisites
StarWind Virtual SAN system requirements
Prior to installing StarWind Virtual SAN, please make sure that the system meets the requirements, which are available via the following link:
https://www.starwindsoftware.com/system-requirements
Recommended RAID settings for HDD and SSD disks:
https://knowledgebase.starwindsoftware.com/guidance/recommended-raid-settings-for-hdd-and-ssd-disks/
Please read StarWind Virtual SAN Best Practices document for additional information:
https://www.starwindsoftware.com/resource-library/starwind-virtual-san-best-practices
Solution diagram
The diagrams below illustrate the network and storage configuration of the solution:
2-node cluster
3-node cluster
Preconfiguring cluster nodes
1. ProxMox cluster should be created before deploying any virtual machines.
2. 2-nodes cluster requires quorum. iSCSI/SMB/NFS cannot be used for this purposes. QDevice-Net package must be installed on 3rd Linux server, which will act as a witness.
https://pve.proxmox.com/wiki/Cluster_Manager#_corosync_external_vote_support
3. Install qdevice on witness server:
1 |
ubuntu# apt install corosync-qnetd |
4. Install qdevice on both cluster nodes:
1 |
pve# apt install corosync-qdevice |
5. Configure quorum running the following command on one of the ProxMox node (change IP address)
1 |
pve# pvecm qdevice setup %IP_Address_Of_Qdevice% |
6. Configure network interfaces on each node to make sure that Synchronization and iSCSI/StarWind heartbeat interfaces are in different subnets and connected according to the network diagram above. In this document, 172.16.10.x subnet is used for iSCSI/StarWind heartbeat traffic, while 172.16.20.x subnet is used for the Synchronization traffic. Choose node and open System -> Network page.
7. Click Create. Choose Linux Bridge.
8. Create Linux Bridge and set IP address. Set MTU to 9000. Click Create.
9. Repeat step 8 for all network adapters, which will be used for Synchronization and iSCSI/StarWind heartbeat traffic.
10. Verify network configuration in /etc/network/interfaces file. Login to the node via SSH and check the contents of the file.
11. Enable IOMMU support in kernel, if PCIe passthourgh will be used to pass RAID Controller, HBA or NVMe drives to the VM. Update grub configuration file.
For Intel CPU:
Add “intel_iommu=on iommu=pt” to GRUB_CMDLINE_LINUX_DEFAULT line in /etc/default/grub file.
For AMD CPU:
Add “iommu=pt” to GRUB_CMDLINE_LINUX_DEFAULT line in /etc/default/grub file.
12. Reboot the host.
13. Repeat steps 6-12 an all nodes.
Deploying Starwind Virtual SAN CVM
1. Download StarWind VSAN CVM KVM: VSAN by StarWind: Overview
2. Extract the VM StarWindAppliance.qcow2 file from the downloaded archive.
3. Upload StarWindAppliance.qcow2 file to the Proxmox Host via any SFTP client (e.g. WinSCP) to /root/ directory.
4. Create a VM without OS. Login to Proxmox host via Web GUI. Click Create VM.
5. Choose node to create VM. Enable Start at boot checkbox and set Start/Shutdown order to 1. Click Next.
6. Choose Do not use any media and choose Guest OS Linux. Click Next.
6. Specify system options. Choose Machine type q35 and check the Qemu Agent box. Click Next.
7. Remove all disks from the VM. Click Next.
8. Assign 8 cores to the VM and choose Host CPU type. Click Next.
9. Assign at least 8GB of RAM to the VM. Click Next.
10. Configure Management network for the VM. Click Next.
11. Confirm settings. Click Finish.
12. Connect to Proxmox host via SSH. Attach StarWindAppliance.qcow2 file to the VM.
1 |
qm importdisk 100 /root/StarWindAppliance.qcow2 local-lvm |
13. Open VM and go to Hardware page. Add unused SCSI disk to the VM.
14. Attach Network interfaces for Synchronization and iSCSI/Heartbeat traffic.
15. Open Options page of the VM. Select Boot Order and click Edit.
16. Move scsi0 device as #1 to boot from.
17. Repeat all the steps from this section on other Proxmox hosts.
Configuring StarWind Virtual SAN VM settings
1. Open the VM console and check the IP address received via DHCP (or which was assigned manually).
Another alternative is to log into the VM via console and assign static IP using nmcli if there is no DHCP.
2. Now, open the web browser and enter the IP address of the VM. Log into the VM using the following default credentials:
- Username: user
- Password: rds123RDS
- NOTE: Make sure to check the “Reuse my password for privileged tasks” box.
3. After a successful login, click Accounts on the left sidebar.
4. Select a user and click Set Password.
5. On the left sidebar, click Networking.
Here, the Management IP address of the StarWind Virtual SAN Virtual Machine can be configured, as well as IP addresses for iSCSI and Synchronization networks. In case the Network interface is inactive, click on the interface, turn it on, and set it to Connect automatically.
6. Click on Automatic (DHCP) to set the IP address (DNS and gateway – for Management).
7. The result should look like in the picture below:
NOTE: It is recommended to set MTU to 9000 on interfaces dedicated for iSCSI and Synchronization traffic. Change Automatic to 9000, if required.
8. Alternatively, log into the VM via the Proxmox console and assign a static IP address by editing the configuration file of the interface located by the following path: /etc/sysconfig/network-scripts
9.Open the file corresponding to the Management interface using a text editor, for example: sudo nano /etc/sysconfig/network-scripts/ifcfg-eth0
10. Edit the file:
- Change the line BOOTPROTO=dhcp to: BOOTPROTO=static
- Add the IP settings needed to the file:
- IPADDR=192.168.12.10
- NETMASK=255.255.255.0
- GATEWAY=192.168.12.1
- DNS1=192.168.1.1
11. Restart the interface using the following cmdlet: sudo ifdown eth0, sudo ifup eth0, or restart the VM.
12. Change the Host Name from the System tab by clicking on it:
13. Change System time and NTP settings if required:
14. Repeat the steps above on each StarWind VSAN VM.
Configuring Storage
StarWind Virtual SAN for vSphere can work on top of Hardware RAID or Linux Software RAID (MDADM) inside of the Virtual Machine.
Please select the required option:
Configuring storage with hardware RAID
1. Open VM Hardware page. Click Add -> Hard Disk.
Note. RAID controller can be passed through to the VM. https://pve.proxmox.com/wiki/PCI(e)_Passthrough
2. Set disk size and storage location. Click Add.
3. Start StarWind VSAN CVM.
4. Login to StarWind VSAN VM web console and access the Storage section. Locate the recently added disk in the Drives section and choose it.
5. The added disk does not have any partitions and filesystem. Press the Create Partition Table button to create the partition.
6. Press Create Partition to format the disk and set the mount point. The mount point should be as follows: /mnt/%yourdiskname%
7. On the Storage section, under Content, navigate to the Filesystem tab. Click Mount.
Configuring StarWind Management Console
1. Install StarWind Management Console on each server or on a separate workstation with Windows OS (Windows 7 or higher, Windows Server 2008 R2 and higher) using the installer available here.
NOTE: StarWind Management Console and PowerShell Management Library components are required.
2. Select the appropriate option to apply the StarWind License key.
Once the appropriate license key has been received, it should be applied to StarWind Virtual SAN service via Management Console or PowerShell.
3. Open StarWind Management Console and click Add Server.
4. Type the IP address of the StarWind Virtual SAN in the pop-up window and click OK.
5. Select the server and click Connect.
6. Click Apply Key… on the pop-up window.
7. Select Load license from file and click the Load button.
8. Select the appropriate license key.
As an alternative, PowerShell can be used. Open StarWind InstallLicense.ps1 script with PowerShell ISE as administrator. It can be found here:
C:\Program Files\StarWind Software\StarWind\StarWindX\Samples\powershell\InstallLicense.ps1
Type the IP address of StarWind Virtual SAN VM and credentials of StarWind Virtual SAN service (defaults login: root, password: starwind).
Add the path to the license key.
9. After the license key is applied, StarWind devices can be created.
NOTE: In order to manage StarWind Virtual SAN service (e.g. create ImageFile devices, VTL devices, etc.), StarWind Management Console can be used.
Creating StarWind devices
1. In the StarWind Management Console click to Add Device (advanced) button and open Add Device (advanced) Wizard.
2. Select Hard Disk Device as the type of device to be created.
3. Select Virtual Disk.
4. Specify a virtual disk Name, Location, and Size.
5. Select the Thick provisioned disk type and block size.
NOTE: Use 4096 sector size for targets, connected on Windows-based systems and 512 bytes sector size for targets, connected on Linux-based systems (ESXi/Xen/KVM).
6. Define a caching policy and specify a cache size (in MB). Also, the maximum available cache size can be specified by selecting the appropriate checkbox. Optionally, define the L2 caching policy and cache size.
7. Specify Target Parameters. Select the Target Name checkbox to enter a custom target name. Otherwise, the name is generated automatically in accordance with the specified target alias.
8. Click Create to add a new device and attach it to the target.
9. Click Close to finish the device creation.
10. The successfully added devices appear in the StarWind Management Console.
Select the Required Replication Mode
The replication can be configured using Synchronous “Two-Way” Replication mode:
Synchronous or active-active replication ensures real-time synchronization and load balancing of data between two or three cluster nodes. Such a configuration tolerates the failure of two out of three storage nodes and enables the creation of an effective business continuity plan. With synchronous mirroring, each write operation requires control confirmation from both storage nodes. It guarantees the reliability of data transfers but is demanding in bandwidth since mirroring will not work on high-latency networks.
Synchronous “Two-Way” replication
1. Right-click the recently created device and select Replication Manager from the shortcut menu.
2. Select the Add Replica button in the top menu.
3. Select Synchronous “Two-Way” replication as a replication mode.
4. Specify a partner Host name or IP address and Port Number.
Selecting the Failover Strategy
StarWind provides 2 options for configuring a failover strategy:
Heartbeat
The Heartbeat failover strategy allows avoiding the “split-brain” scenario when the HA cluster nodes are unable to synchronize but continue to accept write commands from the initiators independently. It can occur when all synchronization and heartbeat channels disconnect simultaneously, and the partner nodes do not respond to the node’s requests. As a result, StarWind service assumes the partner nodes to be offline and continues operations on a single-node mode using data written to it.
If at least one heartbeat link is online, StarWind services can communicate with each other via this link. The device with the lowest priority will be marked as not synchronized and get subsequently blocked for the further read and write operations until the synchronization channel resumption. At the same time, the partner device on the synchronized node flushes data from the cache to the disk to preserve data integrity in case the node goes down unexpectedly. It is recommended to assign more independent heartbeat channels during the replica creation to improve system stability and avoid the “split-brain” issue.
With the heartbeat failover strategy, the storage cluster will continue working with only one StarWind node available.
Node Majority
The Node Majority failover strategy ensures the synchronization connection without any additional heartbeat links. The failure-handling process occurs when the node has detected the absence of the connection with the partner.
The main requirement for keeping the node operational is an active connection with more than half of the HA device’s nodes. Calculation of the available partners is based on their “votes”.
In case of a two-node HA storage, all nodes will be disconnected if there is a problem on the node itself, or in communication between them. Therefore, the Node Majority failover strategy requires the addition of the third Witness node or file share (SMB) which participates in the nodes count for the majority, but neither contains data on it nor is involved in processing clients’ requests. In case an HA device is replicated between 3 nodes, no Witness node is required.
With Node Majority failover strategy, failure of only one node can be tolerated. If two nodes fail, the third node will also become unavailable to clients’ requests.
Please select the required option:
Heartbeat
1. Select Failover Strategy.
2. Select Create new Partner Device and click Next.
3. Select a partner device Location and click Next.
4. Select Synchronization Journal Strategy and click Next.
NOTE: There are several options – RAM-based journal (default) and Disk-based journal with failure and continuous strategy, that allow to avoid full synchronization cases.
RAM-based (default) synchronization journal is placed in RAM. Synchronization with RAM journal provides good I/O performance in any scenario. Full synchronization could occur in the cases described in this KB: https://knowledgebase.starwindsoftware.com/explanation/reasons-why-full-synchronization-may-start/
Disk-based journal placed on a separate disk from StarWind devices. It allows to avoid full synchronization for the devices where it’s configured even when StarWind service is being stopped on all nodes.
Disk-based synchronization journal should be placed on a separate, preferably faster disk from StarWind devices. SSDs and NVMe disks are recommended as the device performance is defined by the disk speed, where the journal is located. For example, it can be placed on the OS boot volume.
It is required to allocate 2 MB of disk space for the synchronization journal per 1 TB of HA device size with a disk-based journal configured and 2-way replication and 4MB per 1 TB of HA device size for 3-way replication.
Failure journal – provides good I/O performance, as a RAM-based journal, while all device nodes are in a healthy synchronized state. If a device on one node went into a not synchronized state, the disk-based journal activates and a performance drop could occur as the device performance is defined by the disk speed, where the journal is located. Fast synchronization is not guaranteed in all cases. For example, if a simultaneous hard reset of all nodes occurs, full synchronization will occur.
Continuous journal – guarantees fast synchronization and data consistency in all cases. Although, this strategy has the worst I/O performance, because of frequent write operations to the journal, located on the disk, where the journal is located.
5. Click Change Network Settings.
6. Specify the interfaces for Synchronization and Heartbeat Channels. Click OK and then click Next.
7. In Select Partner Device Initialization Mode, select Synchronize from existing Device and click Next.
8. Click Create Replica. Click Finish to close the wizard.
The successfully added device appears in StarWind Management Console.
9. Follow the same procedure for the creation of other virtual disks that will be used as storage repositories.
Node Majority
There are two ways to configure Witness for 2-nodes StarWind HA device, created with Node Majority Failover Strategy: File Share (SMB) as Witness and additional server as Witness Node.
– Creating HA device with File SHare(SMB) as Witness:
SMB Witness is a file, located on SMB share, which can be accessed by both nodes and help them to eliminate the split-brain issue in case of synchronization connection interruption between the nodes. To set up the SMB file share as a Witness for 2-nodes HA device with Node Majority Failover Strategy, perform the actions, described on this page:
https://www.starwindsoftware.com/help/ConfiguringFileShareSMBasWitness.html
– Creating HA device with Witness Node:
1. Select the Node Majority failover strategy and click Next.
2. Choose Create new Partner Device and click Next.
3. Specify the partner device Location and modify the target name if necessary. Click Next. Select Synchronization Journal strategy and location and click Next.
4. In Network Options for Replication, press the Change network settings button and select the synchronization channel for the HA device.
5. In Specify Interfaces for Synchronization Channels, select the checkboxes with the appropriate networks and click OK. Then click Next.
6. Select Synchronize from existing Device as the partner device initialization mode.
7. Press the Create Replica button and close the wizard.
8. The added devices will appear in StarWind Management Console.
Repeat the steps above to create other virtual disks if necessary.
Adding Witness Node
Witness node can be configured on a separate host or as a virtual machine in a cloud. It requires StarWind Virtual SAN service installed on it.
NOTE: Since the device created in this guide is replicated between 2 active nodes with the Node Majority failover strategy, a Witness node must be added to it.
1. Open StarWind Management Console, right-click on the Servers field and press the Add Server button. Add a new StarWind Server which will be used as the Witness node and click OK.
2. Right-click on the HA device with the configured Node Majority failover policy and select Replication Manager and press the Add Replica button.
3. Select Witness Node.
4. Specify the Witness node Host Name or IP address. The default Port Number is 3261.
5. In Partner Device Setup, specify the Witness device Location. Optionally, modify the target name by clicking the appropriate button.
6. In Network Options for Replication, select the synchronization channel with the Witness node by clicking the Change Network Settings button.
7. Specify the interface for Synchronization and Heartbeat and click OK.
8. Click Create Replica and then close the wizard.
9. Repeat the steps above to create other virtual disks if necessary.
NOTE: To extend an Image File or a StarWind HA device to the required size, please check the article below:
Connecting StarWind HA Storage to Proxmox Hosts
1. Connect to Proxmox host via SSH and install multipathing tools.
1 |
pve# apt-get install multipath-tools |
2. Edit nano /etc/iscsi/initiatorname.iscsi setting the initiator name.
3. Edit /etc/iscsi/iscsid.conf setting the following parameters:
1 2 3 |
node.startup = automatic node.session.timeo.replacement_timeout = 15 node.session.scan = auto |
Note. node.startup = manual is the default parameter, it should be changed to node.startup = automatic.
4. Create file /etc/multipath.conf using the following command:
1 |
touch /etc/multipath.conf |
5. Edit /etc/multipath.conf adding the following content:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
devices{ device{ vendor "STARWIND" product "STARWIND*" path_grouping_policy multibus path_checker "tur" failback immediate path_selector "round-robin 0" rr_min_io 3 rr_weight uniform hardware_handler "1 alua" } } defaults { polling_interval 2 path_selector "round-robin 0" path_grouping_policy multibus uid_attribute ID_SERIAL rr_min_io 100 failback immediate user_friendly_names yes } |
6. Run iSCSI discovery on both nodes:
1 2 |
pve# iscsiadm -m discovery -t st -p 10.20.1.10 pve# iscsiadm -m discovery -t st -p 10.20.1.20 |
7. Connect iSCSI LUNs:
1 2 |
pve# iscsiadm -m node -T iqn.2008-08.com.starwindsoftware:sw1-ds1 -p 10.20.1.10 -l pve# iscsiadm -m node -T iqn.2008-08.com.starwindsoftware:sw2-ds1 -p 10.20.1.20 -l |
8. Get WWID of StarWind HA device:
1 |
/lib/udev/scsi_id -g -u -d /dev/sda |
9. The wwid must be added to the file ‘/etc/multipath/wwids’. To do this, run the following command with the appropriate wwid:
1 |
multipath -a %WWID% |
10. Restart multipath service.
1 |
systemctl restart multipath-tools.service |
11. Check if multipathing is running correctly:
1 |
pve# multipath -ll |
12. Repeat steps 1-11 on every Proxmox host.
13. Create LVM PV on multipathing device:
1 |
pve# pvcreate /dev/mapper/mpatha |
where mpatha – alias for StarWind LUN
14. Create VG on LVM PV:
1 |
pve# vgcreate vg-vms /dev/mapper/mpath0 |
15. Login to Proxmox via Web and go to Datacenter -> Storage. Add new LVM storage based on VG created on top of StarWind HA Device. Enable Shared checkbox. Click Add.
16. Login via SSH to all hosts and run the following command:
1 |
pvscan --cache |
Conclusion
Following this guide, a Proxmox Cluster was deployed and configured with StarWind Virtual SAN (VSAN) running in a CVM on each host. As a result, a virtual shared storage “pool” accessible by all cluster nodes was created for storing highly available virtual machines.