r/SQLServer • • 21d ago

Question SQL Server 2022 x Hyper-V BP

We're currently exploring Hyper-V as an alternative to VMware, like many out there.

We want to do some underlying metric analysis to compare to production, but I'm trying to make sure anything we're creating is designed to best practices.

I appreciate when it comes to virtualized VMs for SQL that you're suppose to enforce a iSCSI controller per virtual disk. But my question is around the underlying disks storing those virtual disks, do people tend to favor a 1:1 mapping - so say D: on it's own logical volume, F: on it's own logical volume rather than one logical volume for every single virtual disk?

Cheers.

2 Upvotes

11 comments sorted by

2

u/vivkkrishnan2005 21d ago

The same metrics used for vmware can be carried for hyperv. Ideally i prefer to keep logs db and os on seperate volumes. But higher costs down not allow to do this so, I make do with what's best

1

u/Far_Television_3671 21d ago

Thanks for the answer, so you have a separate underlying volume on your san for some virtual disks and another for others it that correct?

3

u/jwk6 21d ago

Seperate volumes for OS, data, log and tempdb here. It makes monitoring free disk space and alerting so much easier.

1

u/SQLBek 1 21d ago

"But higher costs down not allow to do this so, I make do with what's best"

What do you mean by this statement? Which costs are you referring to? VMware licensing? CPU or some other resource cost? etc.?

1

u/vivkkrishnan2005 21d ago

Storage and ram costs mainly. We are planning to migrate to AWS and MSSQL 2025

2

u/DavidKleeGeek ‪ ‪Microsoft MVP ‪ ‪ 21d ago

Shoot me a quick DM. I've got a full best practices guide that I can send you! This is what I do for a living :)

2

u/ihaxr 2 21d ago

Controller 1: C:\ drive and any misc drives like audits or SQL traces or temporary backup files

Controller 2: MDF files (SQL Data)

Controller 3: LDF files (SQL Logs)

Controller 4: tempdb

1

u/SQLBek 1 21d ago

A given Hyper-V VM can have up to 4 virtual SCSI controllers. Thus your VM's virtual disks should be distributed amongst those to maximize I/O queues of each virtual SCSI controller. Each of those virtual disks maps to a VHDX file. And you can absolutely have more than 1 VHDX file on a given Cluster Shared Volume (I'm assuming this isn't a standalone Hyper-V host). A given Cluster Shared Volume then maps 1:1 to a SAN LUN/volume, that'll then be connected to the cluster.

So given that architecture, what did you mean by "logical volume"?

And where did you see that a virtualized VM for SQL should only have a single SCSI controller?

Or... you said "iSCSI controller" - so are you presenting SAN LUNs via in-guest iSCSI? That uses an iSCSI initiator and is different from attaching a VHDX file. But even then, it's not a best practice to have a 1:1 iSCSI Initiator to SAN LUN/volume. If you're Hyper-V is a cluster, you'll have multiple iSCSI initiators for each shared LUN, because each host node in the cluster has its own initiator identity.

1

u/Fine_Programmer9895 21d ago

Depends on what’s underneath. On a modern SAN or all-flash array, a separate LUN per virtual disk rarely helps performance, since the array stripes everything across the same disks anyway.

What most people do is group by IO type instead of 1:1: one volume for data, one for logs, one for tempdb. You get cleaner metrics and can put tempdb or logs on faster storage, without managing a pile of LUNs.

Also use fixed-size VHDX and a 64K allocation unit inside the guest. That’s where most of the easy wins are.

0

u/Pure_Ad_2160 21d ago

Usa Hyper-V solo para apps y un servidor aparte solo para datos. Ya sea en un equipo propio o en Azure o AWS