使用VM Workstation8 创建共享磁盘

来源:互联网 发布:为知笔记能保存视频吗 编辑:程序博客网 时间:2024/06/05 01:02

今天准备测试SQL Server 2012 Cluster的功能,但是Cluster需要共享磁盘。按照以前在VM7中的方法增加磁盘然后修改都失败了,后来看到网上用iSCSI Software Initiator模拟共享磁盘的。测试下来完全没有问题,今天把这篇文章转载过来跟大家分享。

 

Creating a SQL Server Failover Cluster in virtual machines is a fantastic learning experience, especially if you have to do everything yourself, not just the SQL Server install. One thing you may be wondering about is how to simulate shared storage if you don't have a SAN available. Luckily, Microsoft has a free download that you can use to do just that. In this blog, I'll show you how to set up shared storage using only virtual machines.

You will need two VMs, one will serve as the storage, and the other is the server that needs to use the storage. Create an Internal network called iSCSI.

VM_Storage: Storage server
Add a second drive for the storage
Windows 2008 R2
Add the iSCSI network
Disable Client for Microsoft Networks
IP: 192.168.2.10
Subnet: 255.255.255.0

VM_Server: Server that needs to use the shared storage
Your choice of Windows server operating systems
Add the iSCSI network
Disable Client for Microsoft Networks
IP: 192.168.2.11
Subnet: 255.255.255.0

Once everything is set up, make sure you can successfully ping one server from the other using the IPs.

Download Microsoft iSCSI Software Initiator . On the VM_Storage, run the installation file, iSCSITargetQFE4.exe, which creates a folder c:\iSCSITarget and launches the iSCSI Target web page. Scroll down on the page to the "Install the Software" section. You'll see links to install the software (Figure 1).

Install the iSCSI target software

Figure 1: Install the iSCSI target software

Install iSCSI Software Target (x64) on VM_Storage to turn it into a storage server. Navigate to the Storage node of Computer Management, and you'll see a new Microsoft iSCSI Software Target node (Figure 2) after the install.

New node under storage

Figure 2: New node under storage

On VM_SERVER, check Administrative Tools to see if the iSCSI Initiator is there. If not, you can install the iSCSI Initiator  from the download. Run iSCSI Initiator on VM_SERVER. Click Yes if asked if you want to start the service. This is where you will configure the connection to VM_STORAGE. On the Discovery tab click Discover Portal (Figure 3). Fill in the IP address of VM_STORAGE and click OK.

Enter storage server IP

Figure 3: Enter storage server IP

Click the Configuration tab to see the Initiator Name (Figure 4). This is the name that VM_STORAGE will see when  assigning disks to target VM_SERVER. Click OK to close the iSCSI Initiator Properties dialog box.

View the initiator name

Figure 4: View the initiator name

Back on VM_STORAGE, right-click on iSCSI Targets to launch the Create iSCSI Target Wizard. On the iSCSI Target Identification page, fill in a name (VM_SERVER) and description for VM_SERVER. On the iSCSI Initiators Identifiers screen, click Browse to find VM_SERVER which will be the initiator name created in the last step (Figure 5). Click Finish and now your VM_SERVER will be listed under the iSCSI Targets node.

Find the target

Figure 5: Find the target

Now let's configure the storage. Click on Disk Management and bring the second disk online, initialize it and format it giving it a drive letter. Once your second disk is ready to go, right-click Devices to launch the Create Virtual Disk Wizard. On the File Screen (Figure 6) supply the path to a virtual hard drive that you want to create on the second disk.

Create a virtual disk

Figure 6: Create a virtual disk

Supply the size for the virtual disk on the Size page. You can actually create multiple virtual disks, so you might want to leave some room for more disks. On the Description page, fill in a name for the drive so you can find it later.

The next screen, Access, is where you connect target servers to drives. Click Add and select the VM_SERVER target to assign it to this drive. If you are building a cluster, you can add multiple targets. Click Finish and you should now see the new disk listed in Devices (Figure 7).

The new virtual disk

Figure 7: The new virtual disk

Go back to VM_SERVER and check the Storage in Computer Management. At this point, you cannot see the storage. Start up iSCSI Initiator again. On the Targets tab, click Connect. Now you should see the new storage in Disk Management. You can bring the disk online, activate it. format it and use it! When working with a cluster, the disk will be active in only one node at a time.

 

文章来源:http://www.bidn.com/blogs/KathiK/ssas/2770/set-up-shared-storage-with-a-vm

 

原创粉丝点击