Saturday, June 18, 2016

Troubleshooting SQL Server log file size with AlwaysOn - Shrinking the logs

The SQL Server logs filled up my hard drive and the database stopped working! Crap!

So some backups were missed and now the log file has filled up the disk. Here is how to shrink the logs.
It's panic time, so lets get some triage done.  
Is this on a Virtual Machine? 
Can you expand the disk size to get your database running again while you figure out the rest?  You might need to go that route if everything has ground to a halt.

Backup the database and logs, shrink the log file

If you don't have your backup priority set for the primary replica/server, do that first.

1. Backup the database on the primary server
2. Backup the transaction logs on the primary.  This will truncate the logs on the primary and all secondary servers
3. Right click on the database to go "Tasks" -> "Shrink" -> "Files"
4. From the "File Type" menu, select "Log" and press OK
Only shrink the logs, you can't shrink the database while your connected to a AlwaysOn Availablity group.

Check to see how much free space is available now in the logs with this command:

DBCC SQLPERF(LOGSPACE)

Hopefully your using less than 5% now.

Now that you fixed that problem, check your backups and figure out why the transaction logs are not getting backed up (truncated).

My Initial Database Log size is too large and SQL will not let me lower the size

If you need to lower the initial log file size (if the shrink was not enough and the log is still big) you will need to remove it from the Availabilty group and take these steps.
This will need to be done during a maintenance window since your going to break AlwaysOn for a while.

1. Create a full backup of the database
2. Go to the database properties (right click on the DB -> properties), under the "options" section, change the database recovery model to "Simple" then press OK
3. Right click on the database to go "Tasks" -> "Shrink" -> "Files"
4. From the "File Type" menu, select "Log" and press OK
5. Go back to database properties -> options and change the recovery model back to "Full" (do not press OK)
6. Click on the "Files" section of the properties window and change the initial size and growth rate of the log file. then press OK
7. The log file is now a reasonable size
8. Join the database back to the AlwaysOn availablity group.


Wednesday, March 23, 2016

If your looking to put Windows 10 IoT on your HP thin clients, here are my tips on doing that.

I picked up some used HP T620 thin clients that had WES7 on them and I wanted to bump them to Win10 after it was released.  The ones that I'm using have a 16GB mSATA SSD drives and 4GB of memory.  I had to wait awhile for HP to get the 10 image out, but now you can install the HP Recovery Image Download Tool (ThinUpdate) 64-bit and that will help you build a USB stick with the Win10 IoT installer on it.
(sp74857.exe)
http://h20564.www2.hp.com/hpsc/swd/public/detail?sp4ts.oid=5404709&swItemId=vc_161298_1&swEnvOid=4195


Be sure to get the free management software too:  HP Device Manager
http://www8.hp.com/us/en/thin-clients/downloads.html#!&pd4=1

If your like me, you don't have the Win10 COA in the BIOS to activate this image, so it wants to block the install because the OS/BIOS check fails. Here is the work around:

Find this file on the flash drive: (Where your Flash drive is drive D:\)
"D:\IBRPE\THINSTATE.CMD"

Near the bottom, look for the deploy section and add -xb switch after IBRPE.EXE
:DEPLOY
REM - Deploy image. Remove C for OS
if exist C:\ call :REMOVEDRV C
%~dp0\IBRPE.EXE -xb %2 %1
goto :EOF


Adding the -xb command line switch disables the OS/BIOS check

After the install completed, I was able to capture the image with HP Device manager and install it on my other thin clients.  I did have to make separate images for both the Dual Core and Quad Core models.

Also, I have not been able to drop the IoT image over ThinOS.  There must be something in the BIOS that blocks that.  Let me know if you find a work-around.

Windows10 IoT is a specialized version of Enterprise, so you may be required to have a KMS server or Enterprise keys in order to activate.  It activated off my KMS server just fine.

Friday, March 04, 2016

SCVMM 2012 R2: There are currently no network adapters with network optimization available on host xxxx

Every time I stand up a new Hyper-V server I run into this message:
There are currently no network adapters with network optimization available on host xxxx.
Here are some of the things that I do to fix it.

Install the latest drivers from the Manufacturer's support site.  OpenManage from Dell didn't install the latest Broadcom drivers for some reason and I still had to download and install them. Check the Version and driver date on the driver after to make sure it actually updated. In March 2015, Broadcom published driver version 17.0 for download that fixes problems with VMQ.

Apply latest BIOS and firmware updates to all host components.
Set the Management network to the top of the binding order.
Configure SMB live migration if bandwidth is greater than 10gbps.
Network Connections, Press Alt to get the menu, Advanced, Advanced settings

Check your driver settings.  You want to make sure that the drivers for the NIC that will be used for Live Migration have been optimized for that.

  • Do you have Virtual Machine Queues (VMQ) enabled?
  • Do you have TCP Chimney Offload enabled? (Also known as TCP Checksum Offload)
  • Jumbo Packet set to 9000 or 9100?
  • Do you have SR-IOV Enabled on your 10GB NIC?
Now run this command from a Administrator CMD window to see what the OS has enabled/disabled:

netsh int tcp show global

Here is what I had:

TCP Global Parameters
----------------------------------------------
Receive-Side Scaling State          : enabled
Chimney Offload State               : disabled

Turn on Receive-Side Scaling State (RSS) with this command:
netsh int tcp set global rss=enabled

Turn on Chimney Offload State with this command:
netsh int tcp set global chimney=automatic

Information about the TCP Chimney Offload, Receive Side Scaling, and
Network Direct Memory Access featureshttps://support.microsoft.com/en-us/kb/951037

Turning on Chimney Offload State
https://technet.microsoft.com/en-us/library/gg162682(v=ws.10).aspx

Configuring Virtual Networks in VMM 2008 R2:
https://technet.microsoft.com/en-us/library/ee236499.aspx

Configuring Virtual Networks in VMM 2012 R2:
https://technet.microsoft.com/en-us/library/gg610603.aspx

This is snip from that page:

Network Optimization Support

With VMM 2008 R2, you can take advantage of network optimization capabilities that are available on hosts that are running Windows Server 2008 R2. VMM 2008 R2 supports both the Virtual Machine Queue (VMQ) and TCP Chimney features, which improve network performance for virtual machines that are bound to a physical network adapter that supports one or both of these features.
Virtual Machine Queue (VMQ). Network adapters that support the VMQ feature can create a unique network queue for each virtual network adapter and then connect that queue directly to the virtual machine’s memory. This connection routes packets directly from the hypervisor to the virtual machine, bypassing much of the processing in the virtualization stack.
TCP Chimney Offload. Network adapters that support the TCP Chimney Offload feature can offload the processing of network traffic from the networking stack. Both of these features increase network performance and reduce CPU utilization. For more information about network optimization, see the Windows Server 2008 R2 documentation.
If network optimization is enabled on a host that is running Windows Server 2008 R2, VMM automatically detects this. When you create a new virtual network in the Host Properties dialog box and then bind it to a network adapter that supports network optimization, the next time that you open the Host Properties dialog box, the Hardware tab will have a read-only property above the Host access check box to indicate that network optimization is available for the virtual network.
For a virtual machine to take advantage of network optimization, you must add a synthetic network adapter on the Hardware Configuration tab of the Virtual Machine Properties dialog box, connect it to a virtual network on which network optimization is available, and then select the Enable virtual network optimizations check box. This feature is not available for an emulated network adapter.

Here's how to check whether your Virtual Network (your NIC) supports the required hardware features: 

Thursday, February 18, 2016

Windows 10 osd capture fails with "windows setup could not configure windows to run on this computer's hardware"

I'm trying to build a thick image for SCCM OSD with Windows 10 Enterprise x64.
I have tried two images so far, one with Win10 LTSB and one with build 1511.
Both have ended with a Hyper-V VM that will not run after the capture (I used an ISO of the capture media from SCCM 2012 R2 1511).
I get this error after the "Getting Devices Ready" section:
"Windows setup could not configure windows to run on this computer's hardware."
I found that if I run Sysprep (no SCCM capture) that it also fails.
I'm running OOBE and Generalize.

SOLUTION:  Don't connect to the domain while building the image and also be sure to delete all accounts and run as the local administrator.

Note: Our ERP system is complicated to install, so doing an automated build is not possible, so comments about me not using MDT or a Task Sequence do not apply.

Summary:
I have the following installed:
All the Windows 10 & Office 2016 updates up to 2/18/2016.
Office 2016 Pro
Adobe Acrobat DC Reader
My ERP system: Infor Visual Manufacturing
Firefox 44.0.1
Sophos Endpoint Protection
Accusoft Prism Plugin 10.3 from Boeing

My Plan is to create a snapshot and then Sysprep.  If it works, then revert and add another app and sysprep again.  Keep doing that until I hit the error.

Test 1: Installed Base Win10 Enterprise 1511 x64 on Hyper-V 2012 R2 with first round of updates. Enable local Administrator account.
Disconnect NIC on VM so that those stupid Modern apps don't update and block Sysprep.
See: https://support.microsoft.com/en-us/kb/2769827
Login as Administrator and delete account that was created during install.
Reboot, login, run sysprep
Result: Pass

Test 2:  Install Office 2016 and all updates for Office 2016.  Reboot, login, sysprep.
Result: Pass

Test 3:  Install Acrobat, Chrome, Firefox and Prism.  Reboot, login, sysprep.
Result: Pass

Test 4 :  Install ERP.  Reboot, login, sysprep.
Result: Pass

It seems that joining my other builds to our Domain might be to blame.
I wonder if Group Policy is causing any of this?
I also made sure to delete all accounts except for Administrator because they started updating as soon as I logged in and then that was blocking sysprep.
During my tests I did the complete build without joining to the domain.
I decided I could install Sophos using SCCM after the image is on the hardware.
Sophos has a KB article on preping the image, but I think I'll stick with using SCCM to install Sophos Antivirus as part of the task sequence.