Monday, October 8, 2012

Setting up NFS Server on Windows 2008 R2 for VMware vSphere



Setting up NFS Server for VMware vSphere

Here I am setting up NFS server in my existing environment, My Active directory is already setup with below configuration
Hostname: AD
IP address: 192.168.33.11
Domain Name: vcloud.lab

Open server manager, right click Active Directory Domain Services and add role services.
 
Check the box "Identity Management for UNIX" (These services maps Unix accounts into active directory) and click on next,  click install on the next screen, once installation get completed it will ask for restart once, you click close. Go with the restart.
Once the server restarted expand vcloud.lab in Active Directory Users and computers. And create new Organization Unit named UnixUsers.

Create a New group named "Unix_Users_group" with default settings inside Unixusers OU.
 
Right click Unix_Users_group under UnixUsers OU and select properties

Go to UNIX Attributes properties. From the drop down menu of NIS Domain select your Domain.(here my domain is "vcloud") keep all other settings default.
Select Members Tab and click Add administrator.
 
Go to Users and right click Administrator account the click properties, on the UNIX Attributes tab, Select vcloud from the NIS Domain. All the other settings will be populated automatically. (if you have added more users in unix_users_group , once you goes to those users Unix attributes tab and enable NIS domain, you will see increment in UID numbers.)
Now next step is to install File server role for NFS services. I am using here my another server called vCenter (this server is hosting my vCenter server and was already pulled in vcloud.lab domain.)
Open Server Manager and right click Roles and select add Roles. Select File services and click next.
Check Services for Network File System on the select role services. And install services.
 Open services for Network File System (NFS) from Administrative Tools.
Right click Services for NFS and click Properties
Check box Active Directory domain name and type your domain name (here mine is vcloud.lab)
I have created NFS_Drive folder on the C drive of vcenter server. Right click and go to properties.
Go to NFS Sharing Tab and Click Manage NFS Sharing.

Select 2 settings and keep rest of the defaults as below screen.

·         Share this folder
·         Allow anonymous access

And next click Permissions button.
Select the type to Read-Write and check the box allow root access.

Open vsphere client. (you can directly connect esxi host as well),  select host, go to configuration tab, then select storage from Hardware, and click on Add Storage.
Click Network File system.

Type the necessary information, Folder name is case sensitive.
Click next then finish and check the result in Storage.

Wednesday, September 19, 2012

Grab vmware posters


Grab your vmware posters from below link.

http://blogs.vmware.com/vsphere/2012/09/vmware-posters.html

Monday, September 10, 2012

VM settings: CD/DVD drive


Client Device:
Very good option, No need to go to server. But your network bandwidth should be strong, Just insert CD/DVD in your client system's CD/DVD tray esxi/esx server over network (You can map iso file to VM as well from client) and just Start installing OS/application. 

How to configure "Client Device"
Power on VM, Open VM console. Click CD/DVD drive icon, if cd/dvd is in Tray just "press connect to D:" (D is my cd/dvd drive on VM) or use connect to iso image on local disk to map ISO file on client computer.


Press connect to ISO image on local disk if you want to mount an ISO file which is stored on client system or on shared drive.

Now here is the tricky part, you will get disconnect from connected CD/DVD drive as soon as you restart the VM and VM booting is so fast you might not get enough time to connect to CD/DVD rom. For this just configure power on boot delay settings from VM settings>Options tab>boot option. Enter 1000 milliseconds (adjust it as per your convenience). And you will get enough time to connect to D drive or map ISO file. (if you are mapping ISO file for first time I will suggest increase milliseconds as per your convenience)


Also make sure in VM bios boot from CD/DVD is selected in the top Queue,

(Trick here, to boot directly into Bios setting as above screenshot select option Force BIOS setup, next time it boots it enters into bios, VM booting is really fast, you might face hard time when wants to go to bios settings)

Host Device:


Just insert CD/DVD on to esx/esxi server and you go, vm will access it.

Make sure you have selected options as below. Here my connected check box is greyed out because vm is powered off.

If you don’t select device status to connected or connect at power on (once you power on vm D drive will get automatically connected if you have selected connect at power on), CD/DVD drive will be in disabled status, it means you have inserted CD/DVD but Host drive is not in use.

(vMotion will not work if device status is connected, it will give the error)

Datastore ISO File:
You will map ISO file which are kept on esxi local disks, vmfs datastore or NFS drive. (here my suggestion is Keep all your ISO file centralize at one shared datastore location, if the same datastore is accessible from another esxi host, vMotion will not get interrupted even if device status is connected)
(If iso files are kept on local disk of host and another host is not able to access it and status is connected vmotion will not work)

CD/DVD drive Modes:

You will be able to edit these settings only when VM is powered off.

Passthrough IDE (raw). Use mode only for remote client device access.

Emulate IDE. Use to access a host CD-ROM device.

The host CD-ROM device is accessed through emulation mode. Passthrough mode is not functional for local host CD-ROM access. You can write or burn a remote CD only through pass-through mode access, but in emulation mode you can only read a CD-ROM from a host CD-ROM device.

Virtual Device Node is similar depict of IDE primary, secondary (master/slave) HDD port on physical system.

Checking and changing device status from RVtools and powercli.

Many time it happens you connect to CD/DVD drive but forget to uncheck connected and destination Host is not able to access cd/dvd from source host, which might cause interruption in vMotion depending on device type settings. It is very hectic if you have multiple VMs (lets say 20, 50 maybe more than 100), you will need to check device status on every VM settings manually.

There is a cool tool RVtools http://www.robware.net/, download and install it.

Log on it, here Localhost is my vcenter.
And check in vCD tab, you will find the status. You can select only vm with connected = true and powered on. Once they are selected click disconnect CD.
Using powercli

To connect to vcenter/esxi through powercli check my blog http://kunaludapi.blogspot.in/2012/09/changing-network-adapter-type-in-vmware.html

What below script does is, retrieve all powered on vm list and configure cd/dvd drive settings to client device type with unchecking connected and connect at poweron.

get-vm | where-object {$_.powerstate -eq "poweredon"} | get-cddrive | set-cddrive -nomedia -startconnected:$false -connected:$false -confirm:$false


Sunday, September 9, 2012

Changing network adapter type in VMware


Changing network adapter type
Figure 1

There is no option available in vsphere client to change the current installed network adapter type, You will have to either install a new network adapter or you can change the existing network adapter type through powercli, you can create a script to change adapter type of all the VM in vcenter or on Esxi server, at one shot.

Figure 2

Open powercli from start menu,

Connect to vCenter server (you can connect directly to esxi server as well), by executing below command you will log onto vcenter server (my vcenter IP address is 192.168.33.12, you can use servername or FQDN as well)
Figure 3

Once the command executed it will pop up and ask for credentials, Make sure you have appropriate permissions on vcenter.

 
Figure 4

Now you are logged into vcenter successfully, you will see something like below, how you are connected to vcentre server.

Figure 5

Find The VM for which you want to change the adapter type. Fire command "get-vm", it query the list of VMs available on vcenter. Here I want to change network adapter type for winxp001.vcloud.lab.
Figure 6

Next command to get details about network adapter type of VM winxp001.vcloud.lab. Here I used get-networkadapter in pipe line to query network adapter details.

Get-VM winxp001.vcloud.lab | get-networkadapter
Figure 7

Now it's time to change network adapter type, below is the link for description about all the available network adapter types.

http://pubs.vmware.com/vsphere-50/index.jsp?topic=%2Fcom.vmware.vsphere.vm_admin.doc_50%2FGUID-AF9E24A8-2CFA-447B-AC83-35D563119667.html

fire below command, next it will ask for confirmation if you want to continue with changing the adapter type

get-vm winxp001.vcloud.lab | Get-NetworkAdapter | set-networkadapter -type vmxnet3

Figure 8

If you check on network adapter under VM settings, you will see the changes.
Figure 9

Here in the above example I changed adapter type for only one VM but if you have multiple servers servers and want to automate changing adapter type using script. Below is the simple script.

Connect to vcenter or esxi host, Create a list of VMs in text file and keep it on reachable location, here I have created list, named the file vmlist.txt and kept it on C drive.

$VMlist = Get-content c:\VMlist.txt
Get-VM $VMlist | Get-NetworkAdapter | set-networkadapter -type vmxnet3 -confirm:$false

Now get-vm will query VM properties and settings from $vmlist which contains text file data, by  piping information into get-networkadapter I am querying network adapter properties and settings, and again I am piping the information into "set-networkadapter -type vmxnet3" to change type. In the last option  "-confirm:$false" is used to skip confirmation (figure 8) and continue with action.