Arvo Bowen
Arvo Bowen

Reputation: 4955

Getting access to a SAN disk / LUN from a virtual machine. Is it possible?

Resources:

node1:     Physical cluster node 1.
node2:     Physical cluster node 2.
cluster1:  Cluster containing node1 and node2 used to host virtual machines.
san1:      Dell md3200 highly available storage device (SAN).
lun1:      A lun dedicated to file server storage located on san1.
driveZ:    A hard drive currently a resource on node1 that is 100GB and has the
           drive letter Z:\.  This drive letter is lun1 that resides on san1.
virtual1:  A virtual server used as a file server only.

Synopsis / Goals: I have two nodes/servers on my network. Theses two nodes (node1 and node2) are part of a cluster (cluster1) that is used for hosting all my virtual machines. There is a SAN involved (san1) that has many LUNs created on it one of which (lun1) will be used to store all data dedicated to a virtual machine (virtual1). Eventually lun1 is created, given the name "storage" and strictly used for the virtual machine "virtual1" to store and access data.

What I have currently in place:

- I currently have created the SAN (san1), created a disk group with the
  virtual disk (storage), and assigned a LUN (lun1) to it.
- I have set up two physical servers that are connected to the SAN via SAS
  cables (multi paths).
- I have set up the clustering feature on those two servers and have hyper-v
  role installed on each as well.
- I have created a cluster (cluster1) with server members node1 and node2.
- I have created a virtual server (virtual1) and made it highly available
  on the cluster (cluster1).

Question: Is it possible to have lun1 (drive z) brought up and accessed by virtual1?

What I have tried: I had the lun1 aka driveZ showing up in node1's disk management. I then added it as a resource to the cluster storage area. I tried to do two different things. (1) I tried to add it as a Cluster Shared Volume, shortly after I realized that only the cluster members could see/access it and not the virtual machines even though they were created as a service under in the cluster. (2) I tried to move the resource (driveZ) to the virtual machine (virtual1) within cluster1. After doing that I went into the virtual machine settings and added the drive as a SCSI drive (using lun1 @ 100GB) and refreshed the Disk Management on the virtual machine (virtual1). The drive showed up and allowed me to assign a drive letter, then asked me if I wanted to format it... What about all my data thats on it?? Was that a bust? Anyway, thats where I'm at right now... Ideas?

Thoughts: Just so I'm clear, all of this is for testing atm... Actual sizes of resources in production greatly differ. I was thinking about adding the driveZ (lun1) as a Cluster Shared Volume, and then add a new Hyper-V virtual SCSI drive (say 50G so later I can try to expand to 100G, the full size of the physical/SAN drive) to my VM. Storing the fixed VHD (Virtual Hard Disk) inside the Cluster Shared Volume "driveZ". I'm testing it out now... But I have concerns... 1) What happens when I try to create a really large VHD (around 7TB)? 2) Can the fixed disk VHD be expanded in any way? I plan on making my new SAN virtual disk larger than 7TB in the future... Currently its going to stay at 7TB but that will expand at some point...

Upvotes: 0

Views: 2659

Answers (1)

Arvo Bowen
Arvo Bowen

Reputation: 4955

Figured it out!

The correct way to do it is...

  1. Setup a SAN, create a disk group with two virtual disks, and assigned LUNs to them.
  2. Setup your 2 physical servers with Win Server 2008 R2, connect them both to the SAN.
  3. Add the Failover Cluster feature, and the Hyper-V role to both servers.
  4. For the two drives (from the SAN), bring them online and initialize them both. Create a simple volume on each drive if you wish, even format them if you want.
  5. Create a cluster, add 1 of the virtual disks from the SAN as a Cluster Shared Volume. This will be used to store the virtual machines on.
  6. Create a virtual machine and store it on the CSV ex: C:\ClusterStorage\Volume1\, then power it up.
  7. The second drive you need to take offline. This should just be a drive on the host server. It has to be offline! When you right click and choose offline, go ahead and right click then go to properties. On that page look for the LUN number and write it down.
  8. Open up the VM settings go down to Scsi controller and add a drive. Choose physical drive and choose the correct LUN number. Hit OK and it should show up in the VM Storage Manager.

As a helpful tool check these pages out...

Configuring Disks and Storage

Hyper-V Clustering Video 1

Hyper-V Clustering Video 2

Hyper-V Clustering Video 3

Hyper-V Clustering Video 4

Hyper-V Clustering Video 5

Upvotes: 1

Related Questions