Friday, November 27, 2009

VMware error: "Another task is already in progress"

Sometimes, in VMware ESX 3.5 and vSphere 4.0, when you try to perform some actions against a virtual machine (like for example to take a snapshot or to rename it) the system throw an exception with the message "Another task is already in progress" even if there are no active tasks.

The solution is to ssh to the physical ESX server that the virtual machine resides on and restart the “mgmt-vmware” service as the user root.

service mgmt-vmware stop
    Stopping VMware ESX Management services:
    VMware ESX Host Agent Watchdog [ OK ]
    VMware ESX Host Agent [ OK ]


Wait 30 seconds and start the service

service mgmt-vmware start
    Starting VMware ESX Management services:
    VMware ESX Host Agent (background) [ OK ]
    Availability report startup (background) [ OK ]


The ESX server and any virtual machines hosted on it will disconnect from the Virtual Infrastructure/vSphere Client and can be reconnected by right clicking on the ESX server and choosing “reconnect”.

When it reconnects attempt the tasks that were failing earlier and they should now as intended.

Friday, November 6, 2009

Exchange 2007 Message Size Limit

In Microsoft Exchange 2007 you have 10Mb limit for messages size. To increase this limit, you have to do several configurations.

After setting the single user mailbox limit from the GUI (Exchange Management Console), go to the shell (Exchange Management Shell) and type the commands below. Uppercase commands print the configuration parameters, "set" commands modify the values.


GET-TRANSPORTCONFIG

set-transportconfig -MaxReceiveSize VALUE
set-transportconfig -MaxRecipientEnvelopeLimit VALUE
set-transportconfig -MaxSendSize VALUE


GET-RECEIVECONNECTOR LIST

set-receiveconnector -MaxMessageSize VALUE (if requested, the "identity" are listed by the upper command)


GET-SENDCONNECTOR LIST


set-sendconnector -MaxMessageSize VALUE (if requested, the "identity" are listed by the upper command)



VALUE can be expressed, for example, like 10000 or 10MB

Monday, September 28, 2009

VMware vSphere Client on Windows 7

VMware vSphere client doesn't work if you have a Windows 7 pc.

When you try to connct to an Esx server or a Virtual Center server, you'll give these errors:

  • Error parsing the server "nome del server" "clients.xml" file.
  • The type initializer for 'VirtualInfrastructure.Utils.HttpWebRequestProxy' threw an exception.

But with this workaround, the program will works fine:

  1. Edit the VpxClient.exe.config file:
    <?xml version="1.0" encoding="utf-8"?>

    <configuration>

    <system.net>

    <connectionManagement>

    <clear/>

    <add address="*" maxconnection="8" />

    </connectionManagement>

    </system.net>

    <appSettings>

    <add key = "protocolports" value = "https:443"/>

    </appSettings>

    <runtime>

    <developmentMode developerInstallation="true"/>

    </runtime>

    </configuration>
  2. Create in C:\Program Files\Vmware\Infrastructure\Virtual Infrastructure Client\Launcher folder (or in the folder qhere you have installed the software) a subfolder called Lib. In this subfolder copy the system.dll .Net file from a non Windows 7 box (see above)
  3. Crete a new system variable named DEVPATH with value C:\Program Files\Vmware\Infrastructure\Virtual Infrastructure Client\Launcher\Lib


Now the program works fine

PS: A copy of the configuration and of the system.dll file are downloadable here.

Wednesday, June 24, 2009

SQL Server Log File Shrink for all databases on a server

If you use SQL Server, you certainly now that the grow up of transacion log file (.ldf file) is a serious problem.

The faster method to resize the transaction log is to do a shrink.

But if there are N databases on a server, a DBA has to repeat the operation for N times. So, I've created this T-Sql script with that you can automatically execute this operation for all databases on a server.


EXECUTE sp_msforeachdb
'USE ?;
DUMP TRANSACTION ? WITH NO_LOG;
DECLARE @LogLogicalName nvarchar(100);
SELECT @LogLogicalName = file_name(2);
DBCC SHRINKFILE(@LogLogicalName, 100);'


sp_msforeachdb: an undocumented microsoft stored procedure that allow to execute T-SQL code on each database on a DB server.

?: the database name given from stored procedure.

file_name(2): a function that return the logical name of db transaction log file.


Wednesday, June 3, 2009

Disable a button after click (Asp.Net)

To disable a button after click, to avoid that a user re-click on it before the completion of the operation, we have tu use javascript.
The problem is that the disable javascript function remove the postback ability of the button.

To bypass this problem, we can use the following code, writing it into Page Load event:

Me.btn.Attributes("onclick") = "this.disabled = true; " & Page.GetPostBackEventReference(btnSub).ToString

Into this code, btn is the id of the button and btnSub is the routine that normally handles btn.Click event