Friday, October 18, 2013

Installing a VM on VMWare ESXi 5.1 over iSCSI

This post will go over how to install a vm in VMWare 5.1 using an iSCSI target on FreeBSD using zfs.  FreeBSD 9.1 will be used in virtualbox with a new virtual drive that will be used as the iscsi target.  The ip of the system will be 10.0.0.3.

Step 1:
Set up the nic of the guest os as a bridged adapter in virtualbox using the host systems ethernet port.

Add a rule to allow the iscsi traffic on the localhost firewall.

iptables -A open -p tcp --dport 3260 -j ACCEPT

Step 2:
Install the necessary packages for iSCSI on FreeBSD.


Step 3:
Create the zvol that will be used as the block device.


Step 4:
Modify the configuration files for istgt.


Step 5:
Start the service and verify targets are available.


Step 6:
Add the iscsi target to vsphere.  From vsphere, select the esxi host and select the "Configuration" tab, then hit "Storage Adapters".  Click "Add..." and select the "iSCSI Software Adapter".  Go to the properties of the new iSCSI Software Adapter  and click the "Dynamic Discovery" tab.  Add the ip of the iSCSI target.


Rescan the adapter, and the target should show up.


Go back to "Storage" on the left hand side of the screen.  Click "Add Storage...", and select "Disk/LUN".  The newly added iscsi target should be available.


Give the new datastore a name, and modify any other options if necessary.  Once done, the new datastore should show up in vsphere.


Step 7:
Install a vm on the iscsi target.  FreeBSD will be installed.  Create a new vm as before, but on the storage section, be sure to select the newly created iscsi device.


And as before, there is a management and a production nic.


Attach an iso as before and go through the installation.



The system will get the next available ip addresses in the management and production networks, that being 192.168.1.12/24 and 172.16.0.12/24, respectively.

No comments:

Post a Comment