Tag: Windows Server

How to shrink a VMDK: Shrinking a virtual disk in VMware ESXi

First open up Disk Management in Computer Management in your guest Windows environment.

Right click the volume on the disk you want to shrink.

Windows will inform you the maximum amount it can shrink the disk by. Choose an amount that you wish to actually shrink it by and click Shrink.

shrinkF

Windows will start the shrinking process and it might take some time and appear to be hanging as Windows will actually be defragmenting the disk in order to consolidate the free space towards the end of the disk before resizing the volume.

Once it is done and you are satisfied that the volume on the disk is the size you want it then you need to shut down the VM.

SSH into the host and copy the VMDK file to make a backup of it, just the descriptor file not the flat file.

cp vmname.vmdk vmname-original.vmdk

Open up the VMDK file in a text editor and find the line that describes the size of the flat file. Similar to the following

# Extent description

RW 209715200 VMFS “vmname-flat.vmdk”

The number is the size of the virtual disk in terms of disk sectors, where each sector is 512 bytes. So a 100GB virtual disk is 209715200 sectors.

You will need to change this number to correspond to the new disk size where x = size in GB

vmdk_size = [x * (1024*1024*1024)] / 512

I have chosen to shrink my disk to 60gb, so my new Extent description now reads as follows:

# Extent description

RW 125829120 VMFS “vmname-flat.vmdk”

You now need to clone the drive to get it to the new size:

vmkfstools -i vmname.vmdk vmname-new.vmdk

The bit we are interested in is the newly created vmname-new-flat.vmdk file.

Rename the old flat file from vmname-flat.vmdk to vmname-flat-old.vmdk

and rename the vmname-new-flat.vmdk file to vmname-flat.vmdk

Start the VM up and it should show the new smaller disk. When you are satisfied that everything is working you can now delete the old unneeded files from your datastore.



Updating WSUS to work with Windows 8 and Server 2012

I have to confess that I haven’t been paying as much attention to WSUS as I should have and even though I had been going in and approving updates as they have become available I failed to notice that my Windows 8 clients and the Windows Server 2012 were being misidentified and hadn’t yet reported to WSUS.

wsus_reporting_error

Windows 8 was being identified as Windows XP Professional x64 Edition and Windows Server 2012 as Windows Server 2003 Standard x64 Edition.

With a little help from http://chapsnet.wordpress.com/ I was able to resolve the issues through the following steps.

First I visited Microsoft to download the Update for WSUS 3.0 SP2 (KB2734608) that allows it to be able to recognise Windows 8 and Windows Server 2012 Operating Systems and download the appropriate updates.

Once installed on the WSUS Server there are a couple of services that need to be reset in order for it to then synchronize correctly and recognise the newer operating systems.

open Command Prompt and run the following commands
IISReset
net stop WSUSService
net start WSUSService

Open the Console, Update the Product List and begin a Synchronisation

Even though my clients had already been connected to the WSUS server prior to the update I only needed to do the following on the Windows Server 2012 machine in order for it to update in the WSUS console. The Windows 8 clients re-identified themselves correctly without anything further needing to be done.

Open an elevated Command Prompt (Win + X menu)
enter the following commands
net stop wuauserv
rd /s %windir%\softwaredistribution\
y
net start wuauserv
wuauclt /update

Running wuauclt /ResetAuthorization /DetectNow at the command prompt on the Windows 2012 server resolved the reporting issue and S300-Win2012 now shows up as both being identiifed as Windows Server 2012 and as having reported in. It looks like there are 3 updates that it requires.

wsus_reporting_resolved



Managing other servers through Server Manager

The Server Manager console in Windows Server 2012 is a great improvement in my opinion over the equivalent in previous versions of Windows Server, as it allows a quick overview of the activity and health of a server through simplified versions of Event Viewer, Services and Performance Monitor all on a single page.

What’s even better is that it can be used to manage and monitor multiple servers. In a larger Enterprise environment I think System Center 2012 would be a better tool, but here where I only really need to be managing about a dozen servers it is perfect. The process to add servers to the console is very straightforward, justs click on Manage and then click Add Servers.
servermanager130701-01

Next you can then perform a search of Active Directory or via DNS to find servers to add. Alternatively you can import servers into the console from a file.
servermanager130701-02

However like me you are likely to see a whole bunch of errors alongside the server names as below. Also please note that you can only currently add servers running Windows Server 2008 or later to the console (you can add other servers but I don’t think that they can be configured so that Server Manager can pull data or send management commands).
servermanager130701-03

That’s the easy bit. The next step is to configure each of the servers that you wish to manage and monitor, information on how to do so is located at http://technet.microsoft.com/en-us/library/hh831456.aspx.

To manage servers that are running Windows Server 2008 R2 or Windows Server 2008, apply the following updates to the older operating systems.

  • .NET Framework 4
  • Windows Management Framework 3.0 The Windows Management Framework 3.0 download package updates Windows Management Instrumentation (WMI) providers on Windows Server 2008 and Windows Server 2008 R2. The updated WMI providers let Server Manager collect information about roles and features that are installed on the managed servers. Until the update is applied, servers that are running Windows Server 2008 or Windows Server 2008 R2 have a manageability status of Not accessible – Verify earlier versions run Windows Management Framework 3.0.
  • The performance update associated with Knowledge Base article 2682011 allows Server Manager to collect performance data from Windows Server 2008 and Windows Server 2008 R2.

However I was still getting the same error message even after installing the three required updates. I verified that the WinRM service was running and so concluded that the firewall was blocking the data. The resolution was to run the command WinRM quickconfig on the server that is to be managed and this then creates a WinRM listener to accept WS-Man requests and creates an exception in the Windows Firewall. The command and output is shown below.

servermanager130701-04

Having configured the server VS022-INFRAS thusly you can now see that the message has changed to Online. Just need to enable the performance counters and then I can move onto configuring the other servers (though it will need to be an out of hours job as the servers are production servers or critical test servers that I can’t restart during normal hours.)

servermanager130701-05



Windows Server 2012 in production

As part of setting up the new office for my company I needed to set up a server to act as a RODC in what would effectively be a branch office until the rest of the company moved in sometime later.

This gave me the perfect opportunity to use Windows Server 2012 in a production environment and as such gain some real world experience with the new OS in preparation for sitting the 70-417 exam to gain my MCSA: Windows Server 2012 certification.

I had previously downloaded a trial version of Server 2012 but after a failed attempt to install it as a VM on VmWare’s ESXi 4.1 I didn’t do much more with it lacking the resources and time. I have since found a method that would enable it, also for Windows 8 which could be useful for our developers who may need to be coding applications for Windows 8 and need test environments.

Installation on our new Dell R620 could have been easier, but this was not the fault of Windows at all. The server arrived sometime yesterday and without a disc so I’d assumed that the OS had come pre-installed. It had not, which caused a little panic. But once I actually received the Windows Server 2012 disc from our suppliers and then pre-configured the server for the OS (which was somewhat straightforward but didn’t work as it should in my opinion) it was very quick and straightforward to install Server 2012.

My experiences were pretty much as described here
http://workinghardinit.wordpress.com/2012/08/24/how-to-deploy-windows-server-2012-on-dell-uefi-nownotes-from-the-field/

Microsoft has been radically improving Windows Server with every release and Server 2012 is possibly the most radical of all. It is fast, efficient and has made server configuration and management a breeze. The new Server Manager has had a very welcome upgrade in functionality. From a single server I can now monitor and manage the critical production servers in my domain, being able to view server infrastructure via role as well as individual server is extremely useful.

Controversially it has the ‘Metro’ interface as it was developed in parallel with Windows 8. Unlike others here I don’t have an issue with it at all, I rarely have to see the dreaded Start Screen spending what time I’m connected via RDP into the server in the desktop environment and Server Manager. Going forward I can see that the new interface will be useful when I’m wanting to do minor server admin tasks via my smartphone or tablet.

I haven’t due to our environment been able to make full use of the native data deduplication that now comes with Server 2012 but it is again a brilliant new feature.

New and improved Hyper-V is a real contender against VMware’s ESXi now.

The only downside is that the RSAT tools to manage it remotely rely on having Windows 8.