Virtualize a SQL Server Instance using DxCLI Quick Start Guide
This quick start guide that describes how to configure and virtualize an instance of Microsoft SQL Server using DxCLI. Using this guide you will create a virtual host, create and format a virtual disk for your cluster nodes, create a disk group, and add a virtual instance of Microsoft SQL Server.
Three nodes (virtual or physical) with DxEnterprise installed and joined together into a cluster. For information about installing and configuring DxEnterprise, please see:
Microsoft SQL Server 2017 or later installed on each server (node). Reference Microsoft documentation for instructions on installing SQL Server.
SAN (network) storage presented and accessible to the DxEnterprise cluster nodes.
A valid DxEnterprise license with availability group management features enabled. If tunnels will be used for availability group connections, tunneling features must also be enabled. A fully featured Developer Edition is available free for non-production use. To purchase DxEnterprise software for production workloads, visit the DH2i Store.
Add a Virtual Host
To add a Vhost, use the
dxcli cluster-add-vhostcommand and include the nodes you want to be attached to the virtual host.
sudo dxcli cluster-add-vhost vhost1 10.1.100.156 UBUNTU1804,UBUNTU2004,RHEL8caution
Ensure that the members you select are all exclusively Windows or Linux machines, not a mixture of both. Mount points for disks will not function across operating system types.
Manage a Disk for your Cluster
You need to manage a disk for the nodes in your Vhost so that SQL Server can store its data on a SAN disk.
sudo dxcli get-diskscommand to gather information on the disks that are available to your cluster.
sudo dxcli get-disks | dxcli format-xmltip
To make the output easier to read you can pipe (redirect) the XML output of
get-disksto the command
Search through the XML output until you find an unmanaged disk that is available to all the nodes participating in the Vhost.tip
You only need to find one
disk idwith a
managedXML attribute of 1. When DxEnterprise manages a disk, it manages it across all nodes.
dxcli add-diskcommand to add the disk to your cluster using the
sudo dxcli add-disk ed455af7-8246-28fb-b5c7-b3ba677f865e
Next, create a volume for the disk using the
dxcli create-volumecommand with your disk id and the size of the volume in bytes. This command will generate a volume id for your disk. Copy this volume id, as you will need it for the next command.
sudo dxcli create-volume ed455af7-8246-28fb-b5c7-b3ba677f865e,1000000000
Format the disk using the
dxcli format-volumecommand, specifying your volume ID, format type, volume name, block size, quick format option, and volume compression.
sudo dxcli format-volume 56b4608b-2dc7-410b-a2ac-0a2ac86daea6 EXT4 textVolume1 4096 quick_format:true compression:false
Create a Diskgroup and Virtualize SQL Server Instance
Set your volume mount point using the
dxcli set-mountpointcommand. Your mount point is the location on your managed SAN disk where your SQL Server data will be stored (e.g.
sudo dxcli set-mountpoint <volume_id> <mount_point>
Add a diskgroup to your virtual host using the
dxcli vhost-set-diskgroupcommand. You must specify your virtual host name as well as your disk ID.
dxcli vhost-set-diskgroup vhost1 ed455af7-8246-28fb-b5c7-b3ba677f865e
Add an instance of Microsoft SQL Server using the
add-instance VHOST1\\MSSQLSERVER 1433 //mnt/testDrive1/data //mnt/testDrive1/logs sa p@ssw0rdcaution
You must provide a SQL Server username and password for non-Windows systems.