Nested Home Lab Setting up Shared Storage Andy Fox VCI VCAP-DCA VCP3 VCP4 Over the years teaching vsphere, several peers, colleagues and students have asked me how I setup shared storage in my nested test environment. Being a Novell instructor teaching SuSE Linux. for me this was the obvious choice. However, most of my colleagues and students are not familiar with Linux, so I have decided to put together a procedure detailing the steps necessary to configure your own shared storage. You will need: VMware Workstation 8 / Player 4 SuSE Linux Enterprise Server 11 Page 1
Contents You will need:... 1 Create the SuSE Linux virtual machine... 3 Install SuSE... 9 Configure the Network... 30 Add Hard Disks for iscsi Luns... 35 Create the NFS folders... 37 Create Lun Partitions... 38 Configure NFS... 40 Configure the iscsi Target... 46 Page 2
Create the SuSE Linux virtual machine Select Create a New Virtual Machine. Page 3
Click Next. Select Linux, SuSE Linux Enterprise 11. Page 4
Choose a name for your virtual machine, and a location to store the files. Accept the default values for the hard disk. Page 5
Choose to Customize the Hardware. Page 6
Alter the CD/DVD drive to point to the SuSE 11 DVD iso. Page 7
Configure the Network Adapter as required so your ESXi hosts can communicate with the SuSE vm. Page 8
Install SuSE Power on the vm. Page 9
Before the Boot from Hard Disk option times out, select Installation (do not press return). Use F2 to select the correct language. Use F3 to select the required resolution, as it will be a text only build, I suggest 800x600. Press return to start the installation. Page 10
Accept the EULA, and select Next. Page 11
Skip the media check, by selecting Next. Page 12
Select to install a new system, and select Next. Page 13
Select the appropriate Clock and Time Zone settings, and click Next. Page 14
Select to install a Physical Machine, and select Next. Page 15
Alter the software selection by clicking on software. Page 16
Deselect (right click - deselect) all patterns except for Base System, Help and Support Documentation and Minimal System, then click on Details. Page 17
Click on the Filter drop-down and select search. Page 18
Type iscsi in the search box, and click search, then select iscsitarget. (this should also select iscsitarget-kmp-pae) Click on Accept. Page 19
A list of additional packages to be installed will appear, click continue. Page 20
Click Install, and confirm installation by clicking Install. Page 21
When the installation has copied all the files the system will reboot, after which you will need to enter a root password, then select Next (TAB to Next then press space, or Alt-N). Page 22
Enter a Hostname (Alt-o to select entry field), and Domain Name (Alt-D to select entry field). Select Write Hostname to /etc/hosts, and deselect Change Hostname via DHCP, then select Next (Alt-N). Page 23
On the Network Configuration screen select Next. Page 24
On the Installation Overview screen, select Next. Page 25
Unless you wish to do so, select Next and do not configure additional Local Users, and select Yes to the warning. Page 26
Select Next at the Release Notes screen. Page 27
On the Hardware Configuration screen, select Next. Page 28
Deselect the option to Clone the System, and select Finish. Page 29
Configure the Network Nested Home Lab - Shared Storage After the system restarts, login as root with the password you chose, then start yast. Page 30
Select Network Devices and Network Settings. Page 31
Select Edit (Alt-i) Page 32
Select IP Address requirements and Hostname (Alt-letter to switch between options). Page 33
Select Routing and enter your default gateway, then select OK, and select Quit. Type init 0 to shutdown the system. Page 34
Add Hard Disks for iscsi Luns Nested Home Lab - Shared Storage Select Edit virtual machine settings. Page 35
Select Add, select Hard Disk, select Create New virtual disk, SCSI, the capacity you require, Next to accept the vmdk file name, then select Finish. Use the same procedure to add as many disks as you wish to the Linux vm. To ensure a consistent environment to the classroom, I add six 10Gb disks, and one 50Gb and one 30Gb. The six 10Gb disks, I use as luns for each host (3 each), and the 50Gb lun I use as SharedVMs, and the 30Gb lun as SharedTMPLs. Once the disks have been added, select OK, then start the vm. Page 36
Create the NFS folders Log in as root, and create the directories for use with NFS. To keep with the classroom configuration, I create the /iso folder together with /LUN1 and /LUN2 for each host to connect to. Page 37
Create Lun Partitions Type fdisk -l more to display the disks you have added. Only /dev/sda will have any partitions. For each disk you wish to use with vsphere using iscsi, you must create a VMware partition. To do this, start fdisk with the disk device name you wish to create a partition on. Page 38
Type n for a new partition. Type p for a primary partition. Type 1 for primary partition number 1. Select the first cylinder (press return for the first cylinder). Select the last cylinder (press return for the last cylinder). Type t to change the type of partition. Type fb to change the partition to a VMware VMFS partition. Do the same for all disks you have added for use as iscsi luns. Start yast. Page 39
Configure NFS Select NFS Server. Page 40
If you get the above message, select Install (Alt-i). Page 41
Select to Start the NFS Server (Alt-s). Enter the NFSv4 domain name (Alt-m). Make sure to disable NFSv4 (Alt-v). Select Next. Page 42
Select Add Directory (Alt-D). Page 43
Select Browse (Alt-b). Page 44
Browse and select the directory to export, in the options ensure that you have rw,no_root_squash,sync. (You will need to alter root_squash, and add rw) Use the same procedure to add all the folders you wish to export using NFS, then select Finish. Page 45
Configure the iscsi Target Nested Home Lab - Shared Storage In Network Services, select iscsi Target. Page 46
Select When Booting (Alt-b). Select Global (Alt-g), and select any authentication if you require. I leave connections unauthenticated. Select Targets (Alt-t). Page 47
Select Add (Alt-a). Page 48
Alter the Target iqn if required (Alt-t). Alter the identifier if required (Alt-i). Select Add (Alt-a). Page 49
Enter the desired lun number, the device name and partition to use (e.g. /dev/sdb1), and the scsi id, then select OK. Page 50
Do the same for each disk you have added and created a partition on for use with iscsi. Select Next (Alt-n). Page 51
Select Next (Alt-n) for any additional iscsi configuration screens that appear (e.g. Modify iscsi Target). On the Targets screen, delete the example Target, then select Finish (Alt-F). Select Yes to restart the iscsi target software. Select Quit (Alt-q) to exit yast. Type exit to log out. That's it! You should now be able to add the SuSE vm as an iscsi Target, and mount the NFS folders. Page 52