Creating a cluster with PowerShell

I’m obviously so late with this post that others (Jan Egil Ring) have posted about this already. Considering he’s running a blog about Powershell, his script most likely looks a lot better than mine too…

Below is the script I used at TechEd in Berlin to create my 2-node cluster. You can watch the video from TechEd if you’re interested in knowing more about clustering. It’s Symon Perryman, PM from Microsoft that does most of the talking. I’m the demo guy 🙂

Note that in this script a lot of the information is hardcoded, such as nodenames, iscsi-information and ip-addresses. I’m working on a version which will ask you for the needed information but I haven’t finished it yet, this ought to get you started though.


cls
write-host -foreground red "CREATING A 2-NODE CLUSTER WITH POWERSHELL`n`n"
sleep 3
#Start iSCSI
write-host "STARTING iSCSI SERVICE ON NODE FS01"
sleep 1
icm fs01 -scriptblock {set-service msiscsi -startuptype automatic}
icm fs01 -scriptblock {start-service msiscsi}
write-host "STARTING iSCSI SERVICE ON NODE FS02"
sleep 1
icm fs02 -scriptblock {set-service msiscsi -startuptype automatic}
icm fs02 -scriptblock {start-service msiscsi}

#Connect disks
write-host -foreground red "`nCONFIGURING iSCSI CONNECTIONS`n`n"
icm fs01,fs02 -scriptblock {iscsicli qaddtargetportal 10.10.10.20}
icm fs01,fs02 -scriptblock {iscsicli persistentlogintarget iqn.clu02-quorum T * * * * * * * * * * * * * * * 0}
icm fs01,fs02 -scriptblock {iscsicli persistentlogintarget iqn.clu02-storage T * * * * * * * * * * * * * * * 0}
icm fs01,fs02 -scriptblock {iscsicli qlogintarget iqn.clu02-quorum}
icm fs01,fs02 -scriptblock {iscsicli qlogintarget iqn.clu02-storage}
#Partition and format
write-host -foreground red "`NPARTITIONING AND FORMATTING DISKS`N`N"
icm fs01 -scriptblock {sc $env:tempdiskpart.txt @"
list disk
select disk 1
online disk
att disk clear readonly
clean
create partition primary
format fs=ntfs quick
assign letter=q
select disk 2
online disk
att disk clear readonly
clean
create partition primary
format fs=ntfs quick
assign letter=s
"@ -encoding ascii}
icm fs01 -scriptblock {diskpart /s $env:tempdiskpart.txt}
#Install feature
write-host "`NINSTALLING FAILOVER-CLUSTER FEATURE`n`n"
icm fs01,fs02 -scriptblock {load-mo -install Failover-Clustering}
#Create cluster
write-host -foreground red "`nCREATING CLUSTER`n`n"
New-Cluster FileCluster01 -Node fs01,fs02 -staticaddress 192.168.0.111
#Add disks
write-host -foreground red "`nADDING DISKS TO CLUSTER`n`n"
Get-ClusterAvailableDisk | Add-ClusterDisk

Cisco 1130AG – from lightweigt to autonomous mode with TFPT

At work we happened to have a Cisco 1130AG left over. I decided to use it in our lab setup so I went on to configure it. After about 30 minutes troubleshooting, getting hang of a serial cable and googling for how to actually connect and configure it I realized that it was in what Cisco calls “lightweight” mode. This means that the AP has a minimal operatingsystem and gets all its configuration from a Cisco controller. Well, we only have one AP so I didn’t see the need to install all that into our infrastructure. So how do you get your lightweight AP to a fullblown one so that you can configure it?

You’ll need a tftp-server with an ip between 10.0.0.2 – 10.0.0.30 (this is most likely hardcoded into the rom of the AP).
You’ll need to obtain the file from Cisco. This took the longest since their form is “really well constructed”.
Rename the file, place it in the root of the tftp-server and reset your AP by unplugging the power, pressing the mode-button and plug it back in. Hold the mode-button for 20 seconds (until the R-light turns red).

Verify in the tfpt-log that the AP has gotten the image, it’ll then reboot and you can configure it normally. See link to the manual at the bottom of this post.

Oh, and don’t miss the small but important part of allowing TFTP through the firewall on your workstation… I won’t say that I missed it, but it’s a crucial part of making it work.

That’s our little venture into the Cisco world. We’ll see if we go back 🙂











Installation guide:http://www.cisco.com/en/US/docs/wireless/access_point/1130/installation/guide/113h_c4.html

Obtaining your iOS-image:
(You’ll need to register first, that takes a while considering the very nice form Cisco has made… Make sure to repeatedly fill in your password, don’t use international characters in any field, and be quick so you can submit that form before your session expires. Maybe some of all that R&D budget should go to the web-guys?)
http://www.cisco.com/cisco/web/download/index.html
http://www.cisco.com/en/US/docs/wireless/access_point/1130/installation/guide/113h_c4.html#wp1092502

Download the TFPD-server:
http://tftpd32.jounin.net/

Step-by-step from Cisco:
http://www.cisco.com/en/US/docs/wireless/access_point/1130/installation/guide/113h_c4.html#wp1085457

Enable TPM in task sequence with SCCM and CCTK

During work me and a colleague have tested some utilities for handling hardware settings on both servers and clients. One of the more useful utilites we found was CCTK, Client Configuration ToolKit. This utility lets you change settings in BIOS, both during OSD and otherwise. The main usage we found for it was to enable and activate the TPM-chip on Dell client computers.

So how is it done?

You’ll need to download CCTK from Dells site.

And then run the script in the CCTK-folder to include it in your WinPE image. There’s one script for WinPE 2.1 and one for 3.0. This is due to the fact that the hardware driver needs to be local, it can’t be run from UNC.

Once it’s included you can run CCTK from command line in your task sequence.

The commands available can be found here or you can enable CMD-support in your WinPE and run it manually. It’ll then query BIOS for available switches and you can try it out before putting it in a task sequence.

Our TS looks like this:







All those reboots are because the computer needs to power cycle to both turn on and activate TPM. Once that’s done we apply our OS as usual and finish off with running the bdehdcfg.exe-utility which creates the necessary disk layout for Bitlocker and then we run the standard SCCM task “Enable Bitlocker”. If you don’t apply patches or anything else that’ll make the computer reboot you’ll need to have a “Restart Computer”-action after the disk has been configured.