Category Archives: Uncategorized

How to export a VM from Amazon EC2 to VMware On-Premise

Here are the instructions on how to communicate with Amazon's API to export a VM from Amazon EC2 to a VMware image that gets put into S3 storage.  From that point, you can simply download the VMware image and import it into your VMware environment.

0. Open up a command prompt

1. Setup your java path (you can use JRE or JDK):
set JAVA_HOME="C:\Program Files\Java\jre6"

2. Verify your version with this command (you should see the java version number):
%JAVA_HOME%\bin\java -version

3. Add the bin directory that contains the java executable to your path before other versions of java
set PATH=%java_home%\bin;"%Path%"

4. Verify you can see the java version by executing the following command:
java -version

5. Set the EC2_HOME path
SET EC2_HOME=c:\ec2-api-tools-1.6.5.4

6. Verify the ec2_home using
dir %EC2_HOME%

7. Update the path
set PATH="%PATH%";%EC2_HOME%\bin

8. Setup access key environment variables
set AWS_ACCESS_KEY=XXXXXXXXXXXXXXXXXX
set AWS_SECRET_KEY=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

9. Verify the tools setup -- if setup correctly, we should be able to view our available regions.
ec2-describe-regions

10. Execute the following command:
ec2-create-instance-export-task i-EC2INSTANCENAME -e VMware -f VMDK -c ova -b S3STORAGEBUCKET

Once you have executed the command above, you can use the following commands to track/manage the cloning process.

  • Use ec2-describe-export-tasks to monitor the export progress
  • Use ec2-cancel-export-task to cancel an export task prior to completion

 

Notes: You could easily take steps 1-8 to setup an automated script to connect to amazon's services.  If you would like more information on these steps, here was a great article I ran across explaining everything in detail.

http://docs.amazonwebservices.com/AWSEC2/latest/UserGuide/SettingUp_CommandLine.html

 

How do I create a symbolic folder in windows?

1. Open up a command prompt (Start->cmd)
2. Navigate to the directory where you want your folder.
3. Execute the following command: mklink /D foldertoredirect C:\path\to\another\directory

That's all that is to it!

Note: This works for creating FTP directories that need to redirect to another.

Preventing Drive Letters From Changing During SysPrep

One thing that I found really annoying when doing a sysprep was my drive letters changing. In some environments, drive letters need to remain constant when the machine is being deployed/cloned. Unfortunately, I don't have too awful much experience with sysprep's new unattended.xml file and there doesn't seem to be any clear cut tutorials on how to do this, so I found a nice workaround.

To prevent the drive letters from chaning, use the following steps.
1. Open up the registry (Start->Run->regedit)
2. Navigate to HKEY_LOCAL_MACHINE\System\MountedDrives
3. Make a backup of this. File->Export (save to a place where you can access it soon).
4. Make sure you leave regedit open and run sysprep via command line. Use the /quit switch when running sysprep as we do not want to restart the machine yet.
5. Once sysprep finishes, go back to the registry editor.
6. Import your registry backup. File->Import
7. Restart/Shutdown the machine and deploy

Credit to this answer goes to jthiessn for finding this trick. Make sure to "up" his answer on the Microsoft forum for his fine work 🙂 http://social.technet.microsoft.com/forums/en-US/itprovistadeployment/thread/694daccd-a48d-4529-9aaa-555cda297038

Upgrading SolarWinds 10.3 to 10.4 With NetFlow 3.9 to 3.10

Earlier this week I decided to update NetFlow and came across some weird stuff. I updated NetFlow first, all went all. Updated NPM to 10.4 and all heck broke loose. The following messaged started to popup when going to the Netflow tab of SolarWinds:
"Error: NetFlowService inaccessible. Verify that service is 'Started'. » More Information"

I had tried restarting the SolarWinds Netflow service, rebooting the whole machine, running the repair option of Netflow via the installer, and creating a whole new database; neither of which prevailed.

Finally I opened up a ticket with SolarWinds and it turned out to be database connectivity issues. After troubleshooting with a tech for a few hours, eventually I had this escalated to the dev. team. Turns out that the database configuration file has issues reading "s and they have you replace the passwords with 's.

So the fix:

  1. Open c:\Program Files (x86)\SolarWinds\Orion
  2. Edit the SWNetPerfMon.db file using Notepad
  3. Replace all double quotes (") with single quotes (') around your passwords.
  4. Restart all Solarwinds services using the Orion Service Manager.

Wait a few minutes and you should now start to see the fancy NetFlow charts in SolarWinds 🙂

DNS name does not exist. - Windows Activiation

Issue:
When activating Windows (in this case Server 2008 R2), you receive the following dialog box:
"Code: 0x8007232B Description: DNS name does not exist."

Solution:

If you receive this error, you are more than likely using an ISO from the Microsoft Volume Licensing Center when in reality you want to just use your license key (the OS is looking for your KMS server (Key management services), and if you don't have one, then you receive this DNS failure).

How to:

  1. Click Start, click All Programs, click Accessories, and then right-click Command Prompt.
    1. Click Run as administrator.
  2. Execute the following command (where the X's are your license key :)):
    1. slmgr -ipk xxxxx-xxxxx-xxxxx-xxxxx-xxxxx
  3. You should get a popup saying the key has successfully been installed after you execute the command (there is a delay).  Once you see that, go ahead and activate windows as you normally would.
    1. Start->right click properties on My Computer->Activate...

VMware View Composer Installation Error - Unknown Software Exception

When installing VMware View Composer, I was receiving the following error:
"Application Error, The exception unknown software exception (0x0000409) Occurred"

Turns out this was an issue with installation privileges. Rather than installing the software as a domain administrator, I simply logged into the local Administrator account on the machine and installed it.

Binding Multiple SSL Sites To The Same Port/IP In IIS6

First, all credit goes to Dustin Riley for this article. I have simply copied and pasted it for archival reasons.

The original article can be found here: http://blog.dustinriley.net/2010/03/12/binding-multiple-ssl-sites-to-same-port-in-iis6/

If you attempt to create multiple sites in IIS6 that use the same SSL port (by default 443), then you will get an error message when you try to start the second one stating “IIS was unable to start the site. Another site may already be using the port you configured for this site. Please select a unused port for this site.” To setup SSL on the second site you need to either use a different port or edit the metabase directly. IIS6 comes with a script that will allow you to edit the metabase and add the binding for the second SSL site

The script is located in the Inetpub/AdminScripts directory and will need to be run from there in the command prompt. You will need to know the site identifier for the site you want to add the binding to. You can find this in the IIS Manager, drilling down to Web Sites, it will be in one of the columns in the right pane.

Syntax:
cscript.exe adsutil.vbs set /w3svc//SecureBindings “::”

Example:
cscript.exe adsutil.vbs set /w3svc/1/SecureBindings “:443:server.example.com”

Once you complete this you should be able to start the site in the IIS Manager.

How to extend a hard drive in Windows Server 2003, 2008, Windows 2000 and XP

Copied right from Microsoft's KB, here is how to extend a partition/disk.

  • At a command prompt, type diskpart.exe.
  • Type list volume to display the existing volumes on the computer.
  • Type Select volume volume number where volume number is number of the volume that you want to extend.
  • Type extend [size=n] [disk=n] [noerr]. The following describes the parameters:
    • size=n
      • The space, in megabytes (MB), to add to the current partition. If you do not specify a size, the disk is extended to use all the next contiguous unallocated space.
    • disk=n
      • The dynamic disk on which to extend the volume. Space equal to size=n is allocated on the disk. If no disk is specified, the volume is extended on the current disk.
    • noerr
      • For scripting only. When an error is thrown, this parameter specifies that Diskpart continue to process commands as if the error did not occur. Without the noerr parameter, an error causes Diskpart to exit with an error code.
  • Type exit to exit Diskpart.exe.

When the extend command is complete, you should receive a message that states that Diskpart successfully extended the volume. The new space should be added to the existing drive while maintaining the data on the volume.

The original KB article can be found here: http://support.microsoft.com/kb/325590