Windows *: mscorsvw.exe high CPU usage

Another .NET update later, an hour spent looking this up. Why is mscorsvw.exe using 25% CPU for >30 minutes?

Here’s a short outliner on how to speed it up:

The scripts we’ve provided are a convenience for people who don’t want to deal with a command prompt. If you prefer to use the command prompt, you can use the commands below instead. These commands depend on the version of the .NET Framework you have installed and the version of Windows that you have and whether it’s 32-bit or 64-bit.

  • .NET 4, 4.5, or 4.5.1 Preview on Windows 7 or earlier:c:\Windows\Microsoft.NET\Framework\v4.0.30319\ngen.exe executeQueuedItems

    On a 64-bit operating system, add:

    c:\Windows\Microsoft.NET\Framework64\v4.0.30319\ngen.exe executeQueuedItems

  • .NET 4, 4.5, or 4.5.1 Preview on Windows 8 or 8.1 Preview:c:\Windows\Microsoft.NET\Framework\v4.0.30319\ngen.exe executeQueuedItems
    schTasks /run /Tn “\Microsoft\Windows\.NET Framework\.NET Framework NGEN v4.0.30319”

    On a 64-bit operating system, add:

    c:\Windows\Microsoft.NET\Framework64\v4.0.30319\ngen.exe executeQueuedItems
    schTasks /run /Tn “\Microsoft\Windows\.NET Framework\.NET Framework NGEN v4.0.30319 64”

  • If you don’t have .NET 4 or later installed, but you do have .NET 2.0 or 3.5, use this command instead:c:\Windows\Microsoft.NET\Framework\v2.0.50727\ngen.exe executeQueuedItems

    On a 64-bit operating system, add:

    c:\Windows\Microsoft.NET\Framework64\v2.0.50727\ngen.exe executeQueuedItems

These commands assume that Windows is installed on the C drive. If that’s not the case, you can change the drive letter, or use the %windir% environment variable (ex: %windir%\Microsoft.NET\Framework\v4.0.30319\ngen.exe executeQueuedItems)

PowerShell – and how to add new DNS servers to remote systems

Well, I’ve been playing around with PowerShell today. I had the task to move (as in change the IP address) two domain controllers into another VLAN. I could have done it the easy way and added the DNS servers by hand (by RDP’ing to each system having these particular DNS servers configured) – which wouldn’t have been very hard considering the domain only has 7 members at this point …

I wanted to do it the proper way, so I ended up asking old uncle Google, and it supplied me with the answers I was looking for.

Now, I executed those few PowerShell lines before changing the IP address of both domain controllers (10.76.15.20 being the old IP and 10.76.20.20 being the new one). After that I changed the IP address on the second (and after a short downtime) on the first domain controller. After both were restored and available again (and I checked with repadmin /showrepl), I ran the script again, this time only setting the new DCs:

Well, considering the time I spent on looking for this and the time I would have needed to change even the seven members – even this is a time saver.

Nexus 5000: Configure CEST

Since I’m living and working in Germany, most of my hardware is using timezone configuration for CEST (or Europe/Berlin).

This here is the simple configuration for our Nexus 5000’s:

Migrating from XenServer to ESXi

For the past two months we’ve been trying to migrate a bunch (90 or so) VMs from XenServer to ESXi … However for some reason on some of them, the Converter Service would crash.

VMware Converter crashing due to rsintcor32.dll
VMware Converter crashing due to rsintcor32.dll

Up till Monday, I had no idea why. I decided to look into the error once again, and this time decided just to Google the failing module… And guess what ? Out came this Citrix forum post regarding the failing module. So, after knowing that rsintcor32.dll belongs to the Citrix System Monitoring Agent service (well, I could have guessed that from the DLLs path :P) I decided to simply stop the service.

And now, we can migrate the remaining VMs to ESXi and get rid of XenServer!

NetScaler: Generate a simple usage statistic per Vserver

One of my co-workers recently approached me, that he needed a simple shell script which would generate a simple report about a Vserver’s current connections. After ironing out a few things with him (he had the intention of it being on a CIFS share on our file-server – which I changed to a simple HTML page) I went to work.

Out came two scripts. One is the collection instance, and the other is the processing instance. First the collection script runs, finds the current HA master node and then collects the Vserver’s current connections. After that script has dumped the information (date, time, current connections) into a file, the processing script will go and create a simple HTML page that’ll show exactly those informations.

You’ll also need to have configured the public key authentification on both HA nodes, since entering a password in combination with scripting is a bit lame.

 

 

VMware templates: post-processing for SUSE Linux Enterprise Server and openSUSE

Well, I’ve been fiddling around with SLES and openSUSE VMware templates. I know it’s a stupid idea when you have a PXE server from which you could install this in a matter of minutes (seriously the SLES PXE installation takes about 5 minutes).

However, when dealing with DMZ’s (yeah, they exist!) you usually don’t have any PXE servers there. So I decided to go with simple VMware templates (like we do with Windows already), but had to iron out a few kinks.

  1. There’s no way to run a set of scripts after the deployment scripts from VMware have been run
  2. The hostname isn’t changed everywhere (/etc/postfix/main.cf for example)

 

So of I went and wrote a short (70 line ..) init script, which will do exactly that.

You’ll also need to create a file (/etc/template), which’ll hold the template’s hostname and will be used for the comparison if VMware’s post-processing is already finished.

MDS9100 firmware updates – generating copy commands

Well, I went to work today … yeah, I know it’s Sunday right ? I ended up updating two MDS9148 switches and I didn’t want to figure out everything all over again. So I put the system image and kickstart onto one of our FTP servers and ran a short bash loop on it:

Now that’ll generate me two lines, which in turn I can use on the MDS’n:

 

XenServer 6.x: Update all hosts in pool

Well, what annoyed me in the past was that I had to patch each XenServer patch by patch (no bulk applying) and when used in combination with UCS blades (especially if those have >250GB RAM), it takes ages to keep a pool up-to-date. So I ended up writing yet another script (I know why I hate Citrix XenServer … the XenCenter GUI is lacking sooooo much) which will download new patches from a directory on a HTTP server and then print the lines necessary to apply the patches to all hosts in a pool.

There’s just a little caveat (not because of the script – but of XenServer’s design): if you switch the pool master before the updates are applied to all host, you’ll need to manually delete the patches from the pool (xe patch-delete) and rerun the script on the new pool master …

XenServer 6.x: Quick VM Protection Policy to VM name-label script

Well, today I ended up writing a short script that’ll give me a list of VMPPs with the VMs that are associated to it.

 

 

vmware-config-tools.pl finished with “Could not find Parent Node”

Well, today I encountered a old problem (or so I thought). Basically a specific udevadm version causes the vmware-config-tools.pl script to error out like this:

 

I’ve had encountered this before in the past, and before there was some explanation on the VMware forums, which I couldn’t locate. Lucky me, the VMware Tools updater keeps modified versions of vmware-tools-config.pl around. So I ended up creating this short diff, so that I may find it in the future – if I still need it: