Wednesday, January 9, 2013

How to resize Windows partition for VMWare virtual machine (Thick Provision Eager Zeroed)?

* I turn the virtual machine off and when I go to Edit Settings / Hard Disk 1, the Provisioned Size is greyed out and I cannot change it. See the picture for more details.


Question: Any idea how to make the hdd bigger in this case? 

* This may not be the case with you but what worked for me in my situation was to "Remove" all the snapshots from the VM (I had 5 in this case). This re-enabled the HD options again. This actually applied to one of my Windows 2008 Servers as well.


enter image description here

Saturday, January 5, 2013

Configure networking from the ESX service console command line

VMware KB:10000258
 
To configure networking from the ESX service console command line:
  1. Ensure the network adapter you want to use is currently connected with the command:

    [root@server root]# esxcfg-nics –l

    The output appears similar to:
    Name PCI Driver Link Speed Duplex Descriptionvmnic0 06:00.00 tg3 Up 1000Mbps Full Broadcom Corporation NetXtreme BCM5721 Gigabit Ethernetvmnic1 07:00.00 tg3 Up 1000Mbps Full Broadcom Corporation NetXtreme BCM5721 Gigabit Ethernet
    In the Link column, Up indicates that the network adapter is available and functioning.
  1. List the current virtual switches with the command:

    [root@server root]# esxcfg-vswitch –l

    The output appears similar to:
    Switch Name Num Ports Used Ports Configured Ports UplinksvSwitch0 32 3 32 vmnic0
    PortGroup Name Internal ID VLAN ID Used Ports Uplinks
    VM Network portgroup2 0 0 vmnic0

    In the example output, there exists a virtual machine network named VM Network with no Service Console portgroup. For illustration, the proceeding steps show you how to create a new virtual switch and place the service console port group on it.
  2. Create a new virtual switch with the command:

    [root@server root]
    # esxcfg-vswitch –a vSwitch1
  3. Create the Service Console portgroup on this new virtual switch:

    [root@server root]# esxcfg-vswitch –A “Service Console” vSwitch1
    Because there is a space in the name (Service Console), you must enclose it in quotation marks.

    Note: To create Service Consoles one at time, you may need to delete all previous settings. For more information, see Recreating Service Console Networking from the command line (1000266).
  4. Up-link vmnic1 to the new virtual switch with the command:

    [root@server root]# esxcfg-vswitch –L vmnic1 vSwitch1
  5. If you need to assign a VLAN, use the command:

    [root@server root]# esxcfg-vswitch -v <VLAN> -p “Service Console” vSwitch0

    where <VLANID> is the VLAN number. A zero here specifies no VLAN.
  6. Verify the new virtual switch configuration with the command:

    [root@server root]# esxcfg-vswitch –l

    The output appears similar to:
    Switch Name Num Ports Used Ports Configured Ports UplinksvSwitch0 32 3 32 vmnic0
    PortGroup Name Internal ID VLAN ID Used Ports UplinksService Console portgroup5 0 1 vmnic0

    Switch Name Num Ports Used Ports Configured Ports Uplinks
    vSwitch1 64 1 64 vmnic1
    PortGroup Name Internal ID VLAN ID Used Ports Uplinks
    Service Console portgroup14 0 1 vmnic1
  7. Create the vswif (Service Console) interface. For example, run the command:

    [root@server root]# esxcfg-vswif –a vswif0 –i 192.168.1.10 –n 255.255.255.0 –p “Service Console”[‘Vnic’ warning] Generated New Mac address, 00:50:xx:xx:xx:xx for vswif0
    Nothing to flush.
  8. Verify the configuration with the command:

    [root@esx]# esxcfg-vswif –lName Port Group IP Address Netmask Broadcast Enabled DHCP
    v
    swif0 Service Console 192.168.1.10 255.255.255.0 192.168.1.255 true false
  9. Verify the networking configuration on the ESX host. See Verifying ESX host networking configuration on the service console (1003796) .

Thursday, January 3, 2013

Manually deleting linked clones or stale virtual desktop entries from VMware View Manager 3.x and 4.0.x

Removing the virtual machine from the ADAM database

Note: Before removing entries from the ADAM database, note the virtual machine name of the desktops that are being removed for reference when editing the Composer Database.

  1. Connect to the View ADAM Database. For more information, see Connecting to the View ADAM Database (2012377).
  2. Windows Server 2008 R2 (vCenter Server)

    To connect to the View ADAM database:
    1. Log in to one of the View Connection Servers as Domain Administrator.
    2. Click Start > Administrative Tools > ADSI Edit.
    3. In the console window, right-click ADSI Edit and Click Connect to.
    4. In the Name field type:

      View ADAM Database
    5. Select Select or type a Distinguished Name or Naming Context.
    6. In the field below Select or type a Distinguished Name or Naming Context, type:

       dc=vdi,dc=vmware,dc=int
    7. Select Select or type a domain or server.
    8. In the field below Select or type a domain or server, type:

       localhost:389

    9. Click OK.
    10. Click View ADAM Database [localhost:389] to expand.
    11. Click DC=vdi,dc=vmware,dc=int to expand.
    Note: If you are unable to connect using dc=vdi,dc=vmware,dc=int, try using dc=vdi;dc=vmware;dc=int.
  3. Locate the GUID of the virtual machine.

    To locate the GUID of the virtual machine:

    1. Right-click the Connection View ADAM Database [localhost:389], and click New > Query.
    2. Under Root of Search, click Browse.. and select the Servers organizational unit.
    3. Click OK.
    4. In the Query String, paste this search string:

      (&(objectClass=pae-VM)(pae-displayname=VirtualMachineName))

      Where VirtualMachineName is the name of the virtual machine for which you are trying to locate the GUID. You may use * or ? as wildcards to match multiple desktops.

    5. Click OK to create the query.
    6. Click the query in the left pane. The virtual machines that match the search are displayed in the right pane.
  4. Record the GUID in cn=<GUID>.
Delete the pae-VM object from the ADAM database:
  1. Locate the OU=SERVERS container.
  2. Locate the corresponding virtual machine's GUID (from above) in the list which can be sorted in ascending or descending order, choose Properties and check the pae-DisplayName attribute to verify the corresponding linked clone virtual machine object.
  3. Delete the pae-VM object.
Notes:
  • Check if there are entries under OU=Desktops and OU=Applications in the ADAM database.
  • A broken pool that does not contain any desktops can be removed from View Manager by removing the pool entry from both the Server Groups and Applications organizational units. However, removing one entry and not the other from the ADAM database results in the java.lang.nullpointerexception error when attempting to view the pools or desktops inventory in View Manager.