Wednesday, April 26, 2017

How to create a Winodws Server 2016 WinPE image in few simple steps

A WinPE is a strip-down version of a Windows OS which can be used for deployment or troubleshooting purposes.
Here I will explain in simple steps, on how to create a WinPE ISO which you can use in your datacenter.
First things first;

  1. Install Windows ADK 8.1 on a Windows Server 2012 R2 or above Virtual Machine.
    1. Ensure you have selected "Windows PE" & "Deployment Tools"
  2.  Once the installation is complete, click start and goto "Deployment and Imaging Tools Environment" cmd prompt. Make sure you right click and "Run as Administrator"
  3. Create a empty folder (eg C:\WinPE_amd64) which can be used to create a working directory for Windows Pre-installation environment.
  4. Use the following command to create a set of standard Windows PE files.
    copype amd64 C:\WinPE_amd64\winpe
  5. Mount boot.wim to the mount folder which is located in the winpe folder.
    Dism /Mount-Image /ImageFile:"C:\WinPE_amd64\winpe\media\sources\boot.wim" /Index:1 /MountDir:"C:\WinPE_amd64\winpe\mount"
  6. Add packages to your environment as needed. In this case I have added .net Framework and Powershell packages for your reference.

    dism /add-package /image:"C:\WinPE_amd64\winpe\mount" /packagepath:"c:\Program Files (x86)\Windows Kits\8.1\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-WMI.cab"

    dism /add-package /image:"C:\WinPE_amd64\winpe\mount" /packagepath:"C:\Program Files (x86)\Windows Kits\8.1\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-NetFx.cab"

    dism /add-package /image:"C:\WinPE_amd64\winpe\mount" /packagepath:"C:\Program Files (x86)\Windows Kits\8.1\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-Scripting.cab"

    dism /add-package /image:"C:\WinPE_amd64\winpe\mount" /packagepath:"C:\Program Files (x86)\Windows Kits\8.1\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-PowerShell.cab"

    Refer to this MSDN page for more on this
  7. Now, create a the ISO using the below command.

    Makewinpemedia /iso "C:\WinPE_amd64\winpe" "C:\WinPE_amd64\winpe_amd64.iso" 

Now, try booting your server off the ISO. Should work like charm. Incase you need network drivers, you will have to include the necessary inf files before you create the ISO.
All the best!

Thursday, October 27, 2016

How To: Move a vCenter Database (SQL Server)

I recently had to move my VMware vCenter database from a SQL Server running on one machine to another. I performed all the tasks of moving the SQL DB from server 1 to server 2, following all the SQL best practices documented on technet and other places but missed a minor caveat mentioned on VMware KBs.

Once my new SQL server was up and running I imported the DB files to create a new database and updated the ODBC Data Sources. Now as I decide to start my VMware Inventory Service, it refuses to start.

On further investigation I find that I had to perform some of the steps mentioned in this VMware KB article to successfully relocate the SQL database that is used by VMware vCenter.



This article explains that you have to update the vcdb.properties file (on the vCenter server) to to point to the new SQL server.
Without this step you will not be able to start the vCenter services.
Lesson learnt for the n'th time. Follow the documentation! Step-by-Step  :)

Friday, May 13, 2011

Convert VMWare Server VM Image to a Hyper-V VM Image

Mission: Convert VMWare Server VM Image to a Hyper-V image:
This article assumes some working knowledge of both VMWare & Hyper-V environments. This article was written assuming you do not have access to MS-SCVMM.
1.Shut down the VMWare Server VM & inspect the vmware server virtual machine files.
2.If it is configured with a single VMDK file, proceed to step 5
3. If No Continue
4. Convert the vmware vm using a VMware vCenter Converter to a vmware VM with a single VMDK file. i.e single file for each drive/HDD in the VM OS.
5. Goto starwind website, register & download StarWind V2V Converter and convert the vmware server image to a vhd file. It might be mentioned as a MS virtual PC image, but it works with Hyper-V too.
6. Convert all vmdks to VHD and copy them over to your hyper-v macine.
7. You still have work to do.
8. Create a hyper-v vm with existing vhd file and select the vhd file with C: or root partition as primary.
9. Add a NIC (make sure its in a different VLAN or in a isolated network so that it doesn't affect the primary VM if its in production) & other HDD as secondary HDD
10. Start the hyper-v VM
11. Remove VMWAre tools (This can be done before the VMDK to VHD conversion also)
12. Restart the VM
13. Install Integration services for Hyper-V
14. Restart the VM
15. Change the machine name and rejoin it to the domain if needed
16. DONEEEE!!!! You are ready to go

Your comments & inputs appreciated.