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.

Wednesday, September 5, 2012

Part 8: Building Microsoft failover clustered HyperV LAB at home

Configuring and Testing high availability of VM.

Before configuring Failover clustering, shutdown VM.
Open failover cluster Manager, right click Services and application and click Configure a service or Application
Select virtual Machine from the list and click next.
Select VM to make it highly available.
 Press next, check your settings on the next screen.
I am ignoring the warning on the next screen (you can view the report and read what is this warning) click finish. (if you get a warning you can proceed but in error you need to sort it out before clicking finish)



Right click VM and start it, once it is up we will test failover.
Once VM is fully up open cmd prompt on AD and type below command
Ping 192.168.33.34 -t

Right click vm > live migrate virtual machine to another note > 1 - live migrate to node hyperv02,
Now VM will move from hyperv01 to hyperv02
If you check the status it is migrating.
 
I got only 2 pings dropped while migration and littlie stretched latency, It means clients accessing VM didn’t even know they are accessing VM from hyperv02. Check it from HyperV manager as well.

Now try simulating Hardware down, Hard reboot Hyperv02, VM should be failover to host Hyperv01 with little downtime. (VM will restart on HyperV01 host).


Part 7: Building Microsoft failover clustered HyperV LAB at home

Building Microsoft failover clustered HyperV LAB at home
Lab configuration: Part 1
Configuring and Testing High Availability of VM: Part 8
Powershell Rocks - Creating virtual Nic cards for testing (Standalone HyperV)
Error resolved: Hyperv cannot be installed: A Hyperviser is already running.

Creating New Virtual Machine

I am creating first Virtual Machine on hyperv01 server. Right click hyperv01, click new, then virtual Machine.

Enter the name for new virtual machine "VM" and store it on P:\VM (Shared clustered disk)

Keep defaults. Memory - 512 MB.
Select vNetwork - virtual network from dropdown box, all the VM's network traffic will pass through vNetwork (Public network - 192.168.33.0/24).

I am giving 40 gb vhdd to VM (remember our shared Disk  P drive is only 20 gb, VM will use space on demand, let's say I have installed OS which will take 10 gb of space, if you check size of the vm.vhd you will find it only 10 GB. As you fill up the data inside vm.vhd it will grow but not beyond 20 gb. If you move vhd file to larger disk size (at least 40 GB). you can fill it upto 40 gb)

I have kept windows 2008 r2 enterprise ISO file on the C drive of hyperV01, I am going to use it to install it on to the VM.
Next screen is a summary about VM settings, click finish.
Now you can see one VM on hyperv01, right click on VM and click connect.
This is console for VM, from here we can control installation and configuration of VM.
We had mapped ISO image while creation of VM and it will boot from it once you start VM, Install windows 2008 R2 and configure below settings, all other settings will be default.

Hostname: VM
IP address: 192.168.33.34
Download PDF copy of this article from --
https://skydrive.live.com/redir?resid=BFEC67332E5B7634!115