Enable Software iSCSI Adapter Using PowerCLI

I recently began studying for the VCAP5-DCA (VDCA550) and in the course of administering a 2 host environment, it’s very rare that I have to use PowerCLI. The time it would take to write the script would easily exceed the time to perform the task by hand. But section 7 of the VCAP5-DCA blueprint states that the exam will cover PowerCLI and vCenter Orchestrator (vCO) so as I go work through the blueprint, I intend on becoming very comfortable with many different tasks in PowerCLI.

From what I’ve read about the VCAP5-DCA (VDCA 550 version), the exam environment now contains 5 hosts. Performing the same task on this many hosts in a limited amount of time is a good opportunity to automate as much as possible. I don’t think creating a powershell script for each minute task is a good use of time but over the course of learning PowerCLI, I will post many PowerCLI scripts that coincide with VCAP5-DCA blueprint objectives.

We’ll begin with enabling the software iSCSI initiator on all hosts in the datacenter. If the environment is already setup with NFS storage, there’s a good chance that the the software iSCSI initiator will need to be added to the hosts to connect to iSCSI storage. The script uses a hardcoded username and password since this is a test environment but I wouldn’t recommend doing that in production. To use in your environment, use your username, password, and name of each host. Make sure the name of your hosts matches what’s in vCenter. If it’s in vCenter with a FQDN, mirror the name in the script. Next, open PowerCLI and run the script with .\iSCSI.ps1.

#variables

$vcenter “name”

$username “username”

$password “password”

$listofhosts = “host1”, “host2”, “host3”


#connect to vcenter

write-host “Connecting to vcenter”

connect-viserver $vcenter -user $username -password $password

#Loop through hosts

foreach ($esxhost in $listofhosts)

{

$currentesxhost = get-vmhost $esxhost

write-host “Enabling software iSCSI initiator on $currentesxhost”

get-vmhoststorage $currentesxhost | set-vmhoststorage -softwareiscsienabled $true

}

write-host “Disconnecting from vcenter”

disconnect-viserver $vcenter

Cisco CCNA 640-802 Results

UPDATE: I passed the exam on June 2, 2009

I recently took the CCNA 640-802 for the second time and I wanted to post my performance for each section.

I first took the test on February 19, 2009. I felt about 80% ready for the test when I took it. I didn’t feel that I had a firm grasp on ACLs, NAT, DHCP, EIGRP, or OSPF. But I felt very strong in switching, and basic router operations.

I felt that I was doing ok till around question 13 — it took my by surprise and probably took me 15 minutes to figure it out. I quickly realized that I wasn’t as prepared. Throughout the rest of the test I had a bad feeling.

I finished the exam and it wasn’t that bad — a 778 out of 1000 (825 required to pass). I was pretty impressed with myself. I was a little down but quickly rescheduled for a month later.

Below is the breakdown:

Describe how a network works: 88%
Configure, verify, and troubleshoot a switch with VLANs and interswitch communications: 80%
Implement an IP addressing scheme and IP services to meet network requirements: 33%
Configure, verify, and troubleshoot basic router operation and routing on Cisco devices: 43%
Explain and select the appropriate administrative tasks required for a WLAN: 100%
Identify security threats to a network and describe general methods to mitigate those threats: 80%
Implement, verify, and troubleshoot NAT and ACLs in a medium-size enterprise branch office: 80%
Implement and verify WAN links: 66%

Score: 778 (825 needed to pass)

So, I knew where I needed to improve. Let’s see how I did on March 19, 2009 — a full month of studying 2-3 hours a day.

Describe how a network works: 85%
Configure, verify, and troubleshoot a switch with VLANs and interswitch communications: 66%
Implement an IP addressing scheme and IP services to meet network requirements: 50%
Configure, verify, and troubleshoot basic router operation and routing on Cisco devices: 46%
Explain and select the appropriate administrative tasks required for a WLAN: 100%
Identify security threats to a network and describe general methods to mitigate those threats: 100%
Implement, verify, and troubleshoot NAT and ACLs in a medium-size enterprise branch office: 75%
Implement and verify WAN links: 100%

Score: 776 (needed 825 to pass)

776?! 2 points lower than the first attempt and feeling fully confident and maintaining positive throughout the whole test and finishing with 20 minutes left? Well after losing some sleep last night I believe I identified some things I got wrong and how to make it right. I believe that if I would have gotten the same score on switching and VLANs, I would have passed. As far as scoring so low on the fundamentals of a router — I can’t explain. There’s not much to know — hostname, configuring an interface, setting passwords, vty access, etc.

I really want to retake 640-802 again instead of taking ICND1/2 — If my assumptions on scoring are close to right, I’m probably missing 1-2 too many.

I’m going to think about it over the next few days and make a decision.

If you’re not following me already on twitter, you can do it now. I’m @bdwill.

Follow

Get every new post delivered to your Inbox.