Monday, March 8, 2010

View Composer agent initialization state error (6): Unknown failure (waited 0 seconds)

Perhaps the most useless error message on the planet, right next to PC Load Letter.

Summary:

This error message can appear when deploying View Pool from a Parent VM (aka Gold Image) that has Microsoft’s App-V 4.5 client installed:

View Composer agent initialization state error (6): Unknown failure (waited 0 seconds)

Workaround:

  • On the Parent VM, change the “Application Virtualization Client” service to manual.
  • App-VClientService
      • Next steps are completely voluntary.  The only reason I went further was so that as soon as a user logs into a View session, their App-V applications would show up immediately.
      • Create a batch/cmd file and place it on the root directory of the VM. (Commonly C:\)
        • Open Notepad
        • Paste the following two lines:
          • sc config sftlist start= auto
            sc start sftlist
        • Save the file as a bat or cmd (For this example, I’m naming mine “Custom.bat”)
    • Once you’ve snapshot your changes, all you need to do is change the following setting to use the batch file that was created in the previous step Post synchonization script.
      • QuickPrep
      • Done, this should resolve the stupid error above.

Extra Stuff

One thing the App-V / Softgrid client does is add an entry to the UserInit Key (HKLM\Software\Microsoft\Windows NT\Winlogon) in Windows.  From my understanding, best practice from MS is that your supposed to put a comma after any entry that you append to this key.  App-V 4.5 / Softgrid don’t do this.  So when you install the View Agent, make sure the key reads something like this:

  • C:\WINDOWS\system32\userinit.exe,"C:\Program Files\Softricity\SoftGrid for Windows Desktops\sftdcc.exe","C:\Program Files\VMware\VMware View\Agent\bin\wssm.exe",

It is highly likely this was something left over from Microsoft’s acquisition of Softricity that was never corrected or left to the wayside.

VMWare Update Manager PowerCLI Released

All I can say, it’s about F’N time!  Now I can update my templates on a monthly basis.

http://www.vmware.com/support/developer/ps-libs/vumps/

Requirements:

Tuesday, March 2, 2010

vCenter Permissions/Roles overkill? maybe? maybe not… specifically with View 4.0.1

Related Products:

  • VMWare View 4.0.1
  • VMWare vCenter 4.0 U1

Problem Statement:

When creating a View Desktop Pool, no folder path, or datastores are presented and a whole other slew of errors should you decide NOT to grant the administrator role to the View Composer Service Account.

Resolution:

View Composer Role permissions need to be granted in 1 or 6 places in vCenter depending on how restricted the account should be.  1 place would be to grant the administrator role to the View Composer Service Account @ the vCenter Node Level and propagate down.  If the aim to to restrict access to one cluster/host, then the View Composer Role must be applied to the following areas:

Pictures are provided as an example and are not a reflection of how all vCenter servers are configured/designed.

  1. VM and Templates – Role added to Chosen Target Folder, Gold Image Folder, and the “VMWareViewComposerReplicaFolder
    1. ViewComposerReplicaFolder
  2. Hosts and Clusters – Role added to Host | Cluster
    1. ClustersViewPerms
  3. Datastores – Role added to Datastores related to Cluster or Host chosen.
    1. DatastoresViewedit
  4. Datacenter – Role added to Datacenter node, do NOT propagate the View Composer Role permission.
    1. Datacenter Perms
  5. vCenter – This would be the name of your vCenter server, Add the role to this node, do NOT propagate.
    1. vCenterPerms
  6.  Networking – All networks would need to be sorted into folders and your service account granted read-only permissions all networks or just ones you specify.

Further reading:

I came across something interesting today while I was setting up my production View environment.  One of the requirements when setting up View Composer is that it needs an account that has be part of the administrator group of the Windows OS on the vCenter server.  Not a big deal since we don’t grant access to “BuiltIn\Administrators” rights to vCenter itself.

Now granted, the service account needs rights to vCenter which is up next, requirements state that the vCenter Composer service account be granted what VMWare calls the “View Composer” Role.  ACTUAL View Composer Role Permissions needed, to break it down on one table here it is:

Privilege Group Privilege(s) to Enable
Folder Create Folder
Delete Folder
Datastore Browse Datastore
File Management - (This is listed in the admin guide, VMWare needs to clarify this.)  My understanding is the following:
Allocate Space
Remove File
Virtual Machine Inventory (All Rights)
Configuration (All Rights)
Interaction > Power On
Interaction > Power Off
Interaction > Suspend
Interaction > Reset
State
Provisioning > Clone
Provisioning > Allow Disk Access
Provisioning > Deploy Template
Provisioning > Read Customization Specifications
Resource Assign Virtual Machine to Resource Pool
Global Enable Methods
Disable Methods
NOT in the admin guide:
System Tag
Global Tag
Network NOT in the admin guide:
Assign Network
Sessions NOT in the admin guide:
Validate session
View and Stop sessions

Tuesday, February 16, 2010

vCenter 4.0 U1 Performance Statistics w/ mix of ESX 3.5 and 4.0 Hosts

Configuration:
  • ESX 4.0 U1
  • ESX 3.5 U4
  • vCenter 4.0 U1
Issue:
Discrepancy between tracked metrics and “Statistics Level” set in vCenter.  For instance, Level 1 Statistics Level in 4.0U1 now includes “CPU Ready” in historical tracking.  In vCenter 2.5, this metric was only historically tracked @ Level 3.  However, this seems to only apply to VM’s hosted on ESX 4.0 AND vCenter 4.0.  If the VM is hosted on an ESX 3.5 system, then that metric is not tracked.  Another possible cause for lack of historical metric data may be that SQL jobs are not completing properly.  See SQL Job resolution section.
Hypothesis:
I’m guessing here, but this is likely due to the way ESX 3.5 identifies the metric to vCenter which is probably as Level 3.  Below is what you might see when looking @ a VM’s performance on an ESX 3.5 and 4.0 host.
Examples:
ESX 3.5 VM w/ vCenter 4.0 Stat Lvl 2:
3.5 VM
ESX 4.0 VM w/ vCenter 4.0 Stat Lvl 2:
4.0 VM
References:
SQL Resolution:
This is something I ran into that may have been caused by someone in my group or may have happened during an upgrade.  Essentially, vCenter creates SQL jobs to rollup historical data, if one of these breaks, then you may only notice the issue when/if you change your vCenter Stats level. (New Counters don’t show up.)  In my case, a job was partially working so it would report success upon execution, but was not performing a ‘step’ because the previous step was set to quit upon success rather than proceeding to the next step.
This ‘broken’ job left me with a ‘hist_stat2’ table of 150 Million rows.  So, here are some steps to remedy something like this:
  1. Run the following against each ‘hist_stat#’ table to determine whether you need to truncate the table.  If it takes longer than 5 min to run, you might have a broken SQL job and should probably truncate the table(as long as your SQL server is performing normally)
   1: select count(*) from vpx_hist_stat3


  • The job I had problems with in particular was one named “Past Week stats rollup<databasename>”

  • Step 2 in the job was configured to “Quit the job” on success.  This step should be configured to “Go to the next step” on success.

  • WARNING: These next steps WILL delete all data against the target table and you will lose some historical performance data.  Be sure to have a backup just in case.

    • Once you’ve determined the table that hasn’t been getting rolled up, run the following command to truncate the table:
       1: truncate table vpx_hist_stat3

    Friday, January 1, 2010

    iPhone 文字バケ(MojiBake) gMail

    Summary:
    Sending and receiving emails from the iPhone mail app with Japanese characters are unreadable due to mojibake.

    Details:
    This seems to only occur if you use gMail's ActiveSync option by setting up your account on the iPhone by selecting Microsoft Exchange as the account type.

    Workaround:
    To remedy this, use either POP or IMAP when setting up your 'mail' account. You can still have your iPhone sync contacts and calendars seperately.

    Friday, November 20, 2009

    VM Storage Balancer

    One thing I’ve noticed in vCenter 4.0 is that it now has alarms to monitor datastore sizes and places little ‘warning’ or ‘alert’ icons.  I like it, but it also annoys me because I know I need to do clean up and make sure each of our datastores has a minimum of 20% free space.  So here we are: Move-VMStorageBalance.ps1

    Summary:

    Running this script will attempt to storage vMotion systems in a specified cluster around to datastores that have more than x% of free space before and after the move. Systems with specified DRS rules are omitted by default.  I’ve left some defaults defined in two variables that you will need to change to work for your environment.

    Requirements:

    • Powershell 2.0
    • PowerCLI 4.0
    • vCenter 4.0 or ESX 4.0

    Disclaimer/Caveats:

    • Use this script @ your own risk, I take no responsibility for any awesomeness that might occur.  Test, test, and test more.
    • Script may be SLOW as it works against 1 VM at a time.
      • Fast if the detected cluster datastores are already balanced.
    • Script is only as smart as what information you provide.
    • Script contains no logic to handle VM’s with vmdk’s located on multiple different datastores.
    • If disk performance is an issue in your enviro, then DO NOT RUN this script.

    My Env Before:

    BeforeBalance

    My Env After:

     AfterBalance

    Detailed Logic Walkthrough:

    1. Prompts user for vCenter Name

    1. a. Checks if name is valid exits if not

    2. Prompts for Cluster Name

    1. a. Check if name is valid exits if not

    3. Gathers Datastore information and measures whether there is an aggregate of x% free space available.

    1. a. Excludes datastores that have ‘local’ or ‘nfs_share’ in their name.
    2. b. Exits if the aggregate shows less than x% available.
    3. c. Returns what the script calculated as aggregate datastore capacity.

    4. Checks DRS Rules

    5. Gathers VM’s in cluster and omits any that are apart of DRS Rules

    6. Now it begins a loop per VM.

    1. a. Gathers current datastore data
    2. b. Finds datastores with more than x% free space
      1. i. If none found, assumes cluster has been balanced and exits
      2. ii. If number of datastores with free space is equal to total number of datastores, assumes cluster is balanced and exits.
    3. c. Calculates size of VM by adding all HDD’s and RAM.
    4. d. Subtracts datastore free space amount from calculated VM Size, divides result by datastore capacity to get a percentage of free space if VM moves to targeted datastore.
      1. i. If the calculated percentage is less than x%, VM does not move.
        1. 1. Reports back that VM cannot move to target datastore name.
      2. ii. If the calculated percentage is more than x%, VM moves to new datastore.
        1. 1. Reports back that it is moving VM to targeted datastore name.
      3. iii. If VM already resides on that datastore, nothing happens.
      4. iv. Loop

    7. After loop is completed, script checks to see if there are any datastores with less than x% of free space.

    1. a. If found, reports that additional space may be required to balance datastores.

    If none found, reports that datastores are balanced and should have @ least x% of free space on each datastore.

    Script can be viewed and copied from here

    Monday, October 12, 2009

    Windows 2008 IPv4 gateway keeps disappearing after reboot…

    WindowsLogo

    Config:

    Windows 2008 Std/Ent Sp2 x86

    Summary:

    After reboot of system, the system stops responding to pings and RDP. When accessing IPv4 settings, the gateway is missing, and will blank out every time.

    Workaround:

    1. Regedit
    2. Navigate to HKLM/System/CurrentControlSet/Services/Tcpip/Parameters/Interface/%CLSID%
      • %CLSID% = A unique ID that is associated with each network adapter that you have on the machine. You should have one for each adapter installed on your server.
    3. Change the "DefaultGateway" Regkey and manually type in the correct IP.