Saturday, December 29, 2012

Our new home!

We moved into our new home in Tegucigalpa and its more than we had expected. For those interested, you can find us on Google at http://m.google.com/u/m/AmmPsf

For the lat 3 months we have been living in a very nice 2 bedroom house in La Ceiba. There were four of us in the house - me, Jana, Eugenia, and her son Rigo. It wasn't very large, but there was suffient space for all of us.
When we arrived to our new home, we were surprised about how big and nice it is. There are 2 bedrooms, an office, kitchen, a nook for eating, and a large living room. Rey and Elise left behind quite a few things so there was only a couple items we needed to buy.
The yard is fairly large and we are looking around to see if there is somewhere we can put a garden. I have no idea what kind of vegetables we can grow here, but e are looking forward to trying.

We had an interesting adventure last night. The water system here is new to me and getting to know it is more than a little exciting. Apparently a water truck comes to the community twice a week and fills the pipes with water. Each house has a cistern that fills, and the house uses that water. Ours is a little different than others. Instead of the cistern begin on top of the house, which would use gravity to flow into the house, we have a water pump that pressurizes the house.
We were initially concerned abount how long the water had been in the cistern. So, when we arrived, we began using it quickly to empty the cistern, so that it could be filled with fresh water. When the cistern emptied, I noticed the pump was still running, even though there was no water. Not wanting to damage the pump by running it nonstop, I unplugged it.
The water truck arrived last night and started pressurizing the lines. We checked and confirmed our cistern was filling. However, when I plugged in the pump, nothing was going into the house. We checked all the knobs and confirmed everything was open, by still no water. We were more then a little concerned because I was nighttime and didn't know who we could talk to for help.
We weren't sure if the cistern is large enough for everything we need, so we decided that while water is coming to the house, we would try and fill the pila (a concrete tank that holds water for washing clothes by hand). We grabbed the largest kitchen pot and a large thermos and began carrying water from the cistern to the pila.
Last night we learned a few things - Jana and I can move water faster than a one inch pipe can fill, and for some reason the water pumped into the community is warm.
When we finally finished filling the pila, I took another look at the pump. I figured that because we ran the cistern empty, there just wasn't water in the pump to run properly. I looked all over the house for a water spigot that was downhill (in hopes of bleeding the system of air), but couldn't find anything. I finally went back to the pump to see if there were reset directions and found on the very bottom a small screw-in valve. I opened it up and a lot of air came out, followed by a lot of water. I turned on the pump and put the valve back in and I could immediately tell it was working based on the new sound.
After 30 minutes of playing water brigade, we finally got the water running into the house.

So far e have been working all morning cleaning the house. Washing dishes, sweeping, mopping, washing clothes and much much more.

Christmas in Honduras

Last night was Christmas Eve. Jana and I were expecting a quiet evening with our host family, maybe a candlelight service at a local church, an opening of presents at midnight. I don't think we could have been more wrong.

The tradition here seems to be entirely different than the 'Silent Night' we grew up with in the US. Here Christmas eve is referred to as 'Noche Buena', and is a time for celebration.

We had already been warned about people lighting fireworks, so it didn't surprise us that people were lighting them off all week. However, that didn't prepare us for last night. At midnight it seemed that the entire town came outside and lit off fireworks. There was everything from simple sparklers and fountains, to large bombs the size of your forearm. I don't remember ever seeing that many fireworks at any fourth of July party.

As the fireworks were going off, everyone came out to say Merry Christmas to their neighbors. We really enjoyed being able to wish everyone in the neighborhood a merry Christmas, and to do it while wearing shorts was even better!

Monday, December 03, 2012

Starting December

Its been a bit since I had the opportunity to write on the blog, so I will try and get things caught up here. The weather here in La Ceiba has been quite dynamic. For example, in Seattle, it can be sunny for 5 minutes, then rain for 5 minutes, then sunny again. Its similar here in La Ceiba, except it goes from the mid 80's and sunny to torrential downpour.
Because of the climate, everyone in the city has been sick. The flu hit both of us, but Jana more heavily than me.

We have been enjoying our Spanish classes. We are both feeling more confident in our conversations with others (I am sure I'm getting half the conjugations wrong) and speaking is starting to feel more natural. In fact, we have gotten to the point yesterday that we weren't sure if we were talking in English or Spanish.

I had the opportunity to go to Cayos Cuchinos a few weeks ago. Jana had already been and wasn't up to going again. The group went snorkeling along a reef and I got lots of great pictures, I even got a close-up of a barracuda. After snorkeling, we walked through the forest and saw a Pink Boa. I got brave and got close enough to touch it, but then it started curling up to strike and I backed off.
Probably the most interesting part of the trip was the boat ride back. A cold front was coming in, so the swells were quite large and a lot of spray was coming in. The guides passed out the snorkels so we could actually see what was going on.

All in all, we are enjoying life here. We are looking forward to Christmas with our host family in La Ceiba and then off to Tegucigalpa in January.





Saturday, December 01, 2012

Christmas at Wendy's

We went to Wendy's to use the internet and was quite surprised by some of the balloon art. When was the last time you saw the nativity in the form of balloons?


Sunday, November 04, 2012

What do you drink when the weather is cold?

It's been a little cold here in La Ceiba (I thought about wearing pants the other day), and our host mom decided to give us a treat - hot chocolate. The first time she made it I turned it down thinking that it wasnt really that cold, but as Jana raved about how good it was, I remembered that hot chocolate was invented in Central America by the Mayans. Since everyone here is probably descendants of the Mayans, the coco was probably a lot better than Swiss Miss.

For dinner tonight, Dona Maria made more coco, and my taste buds weren't prepared for the flavor. It had chocolate, cinnamon, orange peel, and something spicy to give it a kick. It was sweet, creamy, flavorful, and spicy. Add some caffeine and you could put Starbucks out of business.

To my choco-holic mother - this coco alone is worth the trip to Honduras

Sunday, October 28, 2012

Having fun with kids in La Ceiba

Jana and I decided was that in order to learn Spanish faster, is to be involved in a local activity. We started by volunteering at the local church on Sundays. We get to help with the 7-10 year olds during the 4pm service, then attend the 6pm Service ourselves.
Additionally, we volunteered at an orphanage in the afternoon. We aren't quite sure how the orphanage works, but it looks like it is a school/daycare for single moms and foster parents. The kids are younger than we expected (2-5 years old) but we are having fun playing with them. Unfortunately, they all seem to want piggy back rides, and they all want them at the same time.

We keep laughing everytime we go into stores because they are all preparing for Christmas already. Its not even Halloween, and they were erecting a giant tree in the mall on Friday.

Otherwise we are enjoying ourselves. Staying safe and healthy.

Wednesday, October 24, 2012

Learned my first Spanish tounge twister today

In order to help speed up and improve my annunciation, my teacher gave me my first tounge twister to memorize and practice.

Tres tristes tigres tragaban trigo en un trigal en tres tristes trastos
​En tres tristes trastos tragaban trigo en un trigal tres tristes tigres

To make things fair, I taught her one in English.

She sells seashells by the seashore.

I told her that I would say mine as quickly as she can say hers.

Sunday, October 21, 2012

Our first outing

Yesterday was our first outing here in La Ceiba, we went to Pico Bonito national park. It started out as a great adventure. We walked through one of the Dole pineapple plantations to get to the mountain, I ave never seen so much pineapple before.
We stared hiking up the mountain and saw a couple of waterfalls. At the second one, Jana was brave enough to jump in and go swimming. She says it was cold, but at least she is braver than me.
We relaxed by the water and ate some food and then it started raining. After it had been raining to a while, it started really raining. Before long it stopped, then started up again. We figured it wasn't going to stop so we started walking back. We made it to the bottom completely soaked and covered in mud. I took my shirt off and had to wring out all the rain.

So, my lifelong (week-long) dream of seeing monkeys in the wild has gone without fulfillment. But it was still a fun trip and we saw lots of stuff while there

Saturday, October 13, 2012

Week 3 and still going strong

Jana and I are still enjoying everything here in Honduras. 3 weeks of Spanish classes and we are learning a lot. We may not be fully fluent by February, but we will be ready for the classrooms. I just hope our future students don't try to 'teach' us new words...

This past week has been on and off rain. Its interesting how quickly the clouds roll in and then downpour. Then, it stops raining just as quickly.

So far we have been enjoying the city of La Ceiba. We have made a few trips into the street market (quite interesting) and actually haggled with the vendors. We have also made a few trips to the beach, it was bright and sunny and no one around.
When we are near the beach we found a great restaurant named Pupuseria Universitaria. They make really great pupusas that have quickly become our favorites

Jana is making friends with every little girl around. First was Genesis (pronounced like Henesy), the grand daughter of Maria. Then there was a girl at the beach, and everywhere she goes.




Sunday, September 30, 2012

First week down

Well, our first week in Honduras is finished, and what a week it's been.

The city of la Ceiba has been having rolling blackouts, with different barrios being effected at different times. On Monday, power went out half way through classes at school, which meant it got very warm very quickly. Luckily some clouds came in and cooled us off.
Then the power went out at Maria's home at 6, halfway through making dinner. Thankfully there was enough to eat. The really interesting part about the outage was that it became fairly dark, and I started seeing little blue streaks floating in the air. Genesis, Maria's granddaughter said they were called luciernaga, or in English, firefly. When we were kids, my brother and I caught fireflies on a trip to west Virginia, but I hadn't seen them since.

Otherwise, jana and I are enjoying our classes and getting to know everyone and where to go in the city. We found a place at the mall that has internet access, so I finally get a chance to post on what is going on. Coming from the realm of Microsoft, its quite surprising when you first see that there is no WiFi anywhere.

I have already made a new best friend, her name is Micha. She belongs to Maria's grandkids who live behind her. We keep joking that her name should be Besos (kisses) because she is always licking our hands.









i have been waiting 5 months for this

Jana and I just made it to San Pedro Sula. Our first stop, after booking the bus, was Espresso Americano.
I think the ice cold granita is one of the best ways to celebrate being back in Honduras

How interesting it is to rely on God

On our trip to La Ceiba, we ended up taking a lengthy bus ride from San Pedro Silva airport.  During the quiet and comfortable ride I got a chance to reflect a bit.
Here I am, no job, no real idea of what is going to happen to me tomorrow, and surprisingly without any cares. I felt quite surprisingly at ease with the whole situation.
This made me reminisce of when I was a kid and would ride with my parents. I didn't really know where we were going, or what we would be doing, but I knew I didn't need to worry about it. My parents always took care of me and always loomed out for me. And even though bad things occasionally happened, they were always there to make sure things went OK.
I find this quite a comforting parallel to Jana and my new adventures. I know today I went to school to try and learn Spanish, but I am not really sure what tomorrow will hold. And the great thing is, I am OK with that

Tuesday, September 18, 2012

We are moving to Honduras!

This is something Jana and I have been discussing for several years, and we are finally making a step toward it. We are going to volunteer at the AFE school (www.afehonduras.org) just outside of the Tegucigalpa city dump.


So the obvious question - Are you crazy?


My thought process
This is a summarized version of my thought process while deciding on going. There was much more thought poured into each and every aspect of the decision, but this summary should hopefully be succinct and to the point. Its hard to shorten months of thought into a few paragraphs, but I will try here.
Faith of a mustard seed
"Truly I tell you, if you have faith as small as a mustard seed, you can say to this mountain, 'Move from here to there,' and it will move. Nothing will be impossible for you." - Matthew 17:20
There are several references in the new testament to the "faith of a mustard seed". If you have ever seen a mustard seed, you know that it is incomprehensibly small; so small that its hard to imagine someone harvesting them.
I have always viewed the reference to a mustard seed in two ways. The first is that you don't have to posses a great deal of faith, you just have to hold on to that littlest bit. This point of view has helped me whenever I feel spiritually lost, alone, abandoned, and empty of faith. Even in the worst of times when I hate God and everyone around me, I have asked myself if I have even a mustard seed of faith left. While that small amount of faith doesnt necessarily change anything at that time, it is helpful to know that when everything else changes, my faith has stayed.
The second way I have viewed the mustard seed analogy is that it is really small and can grow into something really big. The seed doesnt do anything special, just what God has given it to do. By pushing and growing year by year, even when animals eat all of its foliage and the wind breaks off limbs, it gets bigger and bigger. When it comes to faith, I am definitly not a giant, but I am growing. I can often feel myself being pruned or trimmed back, and the dissapointment that comes from not being a "great" or "amazing"; but all I have to do is decide to continue to grow.

Promises of God
Look at the birds of the air; they do not sow or reap or store away in barns, and yet your heavenly Father feeds them. Are you not much more valuable than they? - Matthew 6:26
"Truly I tell you," Jesus said to them, "no one who has left home or wife or brothers or sisters or parents or children for the sake of the kingdom of God will fail to receive many times as much in this age, and in the age to come eternal life." - Luke 18:29-30

God gives us several promises through the bible, Luke 18 seems to be most apt at this time. Throughout the promises of God he never says that nothing bad will happen, or that your life will be full of happiness and only good things. On the contrary, winter comes just as frequently as the summer does, peaceful weather is often followed by horrible storms, and happiness is often followed by sadness.
God is promising us that our lives will be better by following his commands. Even when bad things happen, they wont be as bad as they were before, and the good things will be even better.

God's Calling
Then I heard the voice of the Lord saying, "Whom shall I send? And who will go for us?"
And I said, "Here am I. Send me!" - Isaiah 6:8
When God called Isaiah he didnt search through a pile of resumes like an employer would do. God simply asks "Who is willing?" And when Isaiah heard the calling he didnt list off his credentials, or lineage, or schooling, he simply raised his hand. I cant imaging Isaiah had any idea what he was volunteering for, and I am sure he wasnt yet equipped to do the job God was calling for him to complete.
God asked for help, and Isaiah offered himself. Could there be anything greater than to know you are living for God? That your life is a mission from God? Forget about training, or knowledge, or abilities, or anything else you could bring to the table - God can provide all of that.

Do I trust God?
After going through all of these questions and thoughts, it ultimatly came down to 1 question for me: Do I trust God? Do I trust that leaving my comfy home and comfy job will be blessed?

  • If we sell our house today, we will end up losing money
  • If we leave our jobs for several years, we will lose out on a lot of income
  • If we volunteer, we will have to use our savings to live
  • If we go to a third-world country, we may get sick or hurt
  • If we stop making money today, our retirement will be messed up
  • If I leave my job for a few years, I may have to start over in my skills
  • ....

Do I trust God? Do I trust that God will continue to feed me? Do I trust that God will keep me just as safe in another country as I am in the US? Do I trust that God will take care of my retirement which is 30 years away?


"Then the King will say to those on his right, 'Come, you who are blessed by my Father; take your inheritance, the kingdom prepared for you since the creation of the world. For I was hungry and you gave me something to eat, I was thirsty and you gave me something to drink, I was a stranger and you invited me in, I needed clothes and you clothed me, I was sick and you looked after me, I was in prison and you came to visit me.'
"Then the righteous will answer him, 'Lord, when did we see you hungry and feed you, or thirsty and give you something to drink? When did we see you a stranger and invite you in, or needing clothes and clothe you? When did we see you sick or in prison and go to visit you?'
"The King will reply, 'Truly I tell you, whatever you did for one of the least of these brothers and sisters of mine, you did for me.' - Matthew 25:34-40

Friday, August 17, 2012

Running PowerShell code from a web page

As PowerShell gets used more and more in the IT industry, its not unusual to begin growing libraries of scripts and commands, and even automate some of the scripts to run automatically. After a while, I have developed a method of organizing my library so I can find my scripts as needed, and even include some rudimentary version control.
The growing library becomes an issue when multiple people in your organization are using PowerShell as well. Each person begins growing a library, each person handles versioning independently, and each person may schedule the scripts to run automatically. Suddenly there is a lot of tribal knowledge (i.e. I don't know how to do that, go talk to X).
I had always felt that having some centralized web portal that allowed me to see my organizations scripting library would be ideal. Additionally, it would be awesome if I could simply click a button on a form and make a PowerShell script execute.

  • Need a VM? Fill out this online form and click create.
  • Reboot a host? Select the system to reboot and click go.
  • Restart services? Select the system and service and click Restart.

The first major hurdle to this is getting PowerShell to run through a web page, it turns out this has been around for some time at http://devinfra-us.blogspot.com/2011/02/using-powershell-20-from-aspnet-part-1.html. The example simply imports System.Management.Automation from PowerShell and creates a PowerShell object. Once created, use PowerShell.Commands.AddScript() to import the PS code, and PowerShell.Invoke() to execute.

What next? Add security, tie it into a database to act as the library, maybe add some scheduling...

Tuesday, August 14, 2012

Another Vyatta config guide

I find myself using the Vyatta virtual router (http://www.vyatta.org) for most everytime I need a router. It hasn't yet replaced my core enterprise routers, but it fits in nicely for smaller environments. This example is going to be a basic home configuration - The internet facing interface receives its address via DHCP, the internal interface is static at 10.0.0.1/24 and provides DHCP, DNS, and Proxy services. Additionally, an internal web server is published via HTTPS.
NOTE: I am using Vyatta version 6.4 which changed some of the configuration commands. Confirm the version you are running to ensure the commands are appropriate


1. Deploy the router

Deploying the router is probably the easiest step to perform, especially if you are running VMware. If your running VMware, simply go to http://www.vyatta.com/downloads/vmware_ovf.php to get the link for the latest OVF available. Import this into VMware and your good to go.

If your running some other virtualization stack (Hyper-V, Xen, etc...), you will need to install from ISO. The latest stable version can be found at http://packages.vyatta.com/vyatta/iso/stable/, just download the LiveCD, create a VM with 512MB RAM, 4GB disk, 2 NICs, and boot from the ISO. NOTE: Be careful the type of NIC chosen as not all adapters are supported by Vyatta. For Hyper-V, you have to use the Legacy Network Adapter. The default adapter type will not work
Once booted, log into the console with username/password of vyatta/vyatta. At the prompt type install system, accept the default options, allow the install to overwrite the disk, and set the password. When installed, type poweroff and remove the ISO. Power back up and your up and running.

NOTE: I find it a good step to write down the MAC addresses of the interfaces so I can easily determine which is internal and which is external.

2. Configure the interfaces

Log into the console as the vyatta user and enter configuration mode by typing configure.

Identify the interfaces
The first step needed is to determine which interface is which. We know that we will have 1 interface on the open internet, and the other interface on the trusted network - we obviously dont want to get these backwards.
While in configuration mode, type show interfaces and you will see something similar to below.
vyatta@vyatta# show interfaces
 ethernet eth0 {
     hw-id 00:15:5d:14:ed:2e
 }
 ethernet eth1 {
     hw-id 00:15:5d:14:ed:2f
 }
 loopback lo {
 }

The router sees the interfaces as eth0 and eth1 and provides the associated MAC addresses. Using the MAC addresses of the interfaces, I can determine which interface is which, and even move them based on need. In my case, eth0 is the external interface

Configure DHCP
Since our external interface will be receiving its IP address from our ISP, we configure it to use DHCP. To configure eth0 for DHCP, simply type set interfaces ethernet eth0 address dhcp

Configure Static Address
Our internal network is owned/managed by us, so we can choose to use a private addressing scheme for our systems. To configure eth1 for a static address, simply type set interfaces ethernet eth1 address 10.0.0.1/24

Commit the Changes
Whenever you make a change the the Vyatta configuration, it doesn't take effect until you commit them. Additionally, the changes aren't resilient (don't remain after reboot) until you save them.
To commit the changes, type commit
To save the changes, type save

3. Configure the services

System Names
We want to give our router a descriptive name as well as create an internal domain name. In this case I am naming it intRtr for internet router, and giving it a domain of goad.local. This gives me a unique name and domain to identify the router and other systems.
set system host-name intRtr
set system domain-name goad.local

DHCP
Next we configure the DHCP server on the router. This involves creating a pool of addresses for DHCP to use, configuring the default gateway, DNS server and domain name.

set service dhcp-server shared-network-name ETH1_POOL subnet 10.0.0.0/24 start 10.0.0.65 stop 10.0.0.199
set service dhcp-server shared-network-name ETH1_POOL subnet 10.0.0.0/24 default-router 10.0.0.1
set service dhcp-server shared-network-name ETH1_POOL subnet 10.0.0.0/24 dns-server 10.0.0.1
set service dhcp-server shared-network-name ETH1_POOL subnet 10.0.0.0/24 domain-name goad.local
set service dhcp-server shared-network-name ETH1_POOL authoritative enable 


DNS
Now that clients have DHCP addresses, it is time to configure the DNS server. In this case we are creating a caching DNS server that receives requests, forwards them to the external DNS server, and caches them for future reference. This speeds up recurring requests, as well as contains the configuration for easy management.

set service dns forwarding dhcp eth0
set service dns forwarding listen-on eth1


PROXY
Now we set the outbound proxy
set service webproxy listen-address 10.0.0.1
set service webproxy listen-address 10.0.0.1 disable-transparent
NOTE: This means that clients will have to configure their browsers as http://10.0.0.1:3128 to utilize the proxy

4. Configure outbound NAT for all traffic

For anything other that web traffic (or web traffic we don't want to proxy), we enable Network Address Translation.

set nat source rule 10 source address 10.0.0.0/24
set nat source rule 10 outbound-interface eth0
set nat source rule 10 translation address masquerade

5. Configure web publishing

Finally, we want to publish the web server so that when someone browses to port 443 on the external interface, it is forwarded internally.

set nat destination rule 200 destination port https
set nat destination rule 200 inbound-interface eth0
set nat destination rule 200 translation address 10.0.0.2
set nat destination rule 200 translation port https
set nat destination rule 200 protocol tcp
set interfaces ethernet eth0 firewall in name FROM-EXTERNAL
set firewall name FROM-EXTERNAL description "Block Unwanted Internet Traffic"
set firewall name FROM-EXTERNAL rule 10 description "Accept Established-Related Connections"
set firewall name FROM-EXTERNAL rule 10 action accept
set firewall name FROM-EXTERNAL rule 10 state established enable
set firewall name FROM-EXTERNAL rule 10 state related enable
set firewall name FROM-EXTERNAL rule 20 description "Allow https"
set firewall name FROM-EXTERNAL rule 20 action accept
set firewall name FROM-EXTERNAL rule 20 destination address 10.0.0.2
set firewall name FROM-EXTERNAL rule 20 destination port https
set firewall name FROM-EXTERNAL rule 20 protocol tcp


Thats it, commit and save and your golden

Monday, August 13, 2012

Powershell cmdlets for Hyper-V in Windows Server 8

I had the opportunity to do a little lab time today and I was looking forward to working with Windows Server 8. My test lab is essentially a single Hyper-V server, and a client to access the environment. As such, I wanted to see what I could do in order to speed up my testing.

Long ago I learned that Hyper-V can create differencing disks - i.e. you create a "gold master" image of an OS, and then create one or more differencing disks based on the master image. This prevents you from having to re-install the OS everytime you rebuild your lab, but still required a good deal of clicking to build the VM and VHD appropriately.

Enter PowerShell - the way to automate everything windows. In Server 8, the built-in cmdlets are significantly better, and there is a list of available cmds at http://technet.microsoft.com/library/hh848559.aspx.

I created a base install of Server 8 and sysprep'd it (c:\windows\system32\sysprep\sysprep.exe). Once the system shutdown, I went into the filesystem of the Hyper-V server and created a "Templates" folder and moved the new vhdx into it. Rename the file to Server8_Template.vhdx and we are all set.

To create a new Server 8 VM I need to perform two steps: 1) Create the differencing hard disk, 2) Create the VM using the harddisk. In my case the VHD's are on the E:\ drive of my Hyper-V server HyperTest
Create the differencing disk:
New-vhd "e:\vm\Virtual Hard Disks\DC1.vhdx" -ParentPath e:\vm\template\Server8_template.vhdx -computername HyperTest

Create the VM:
new-vm -Name DC1 -ComputerName HyperTest -memorystartupbytes 1073741824 -VHDPath "e:\vm\Virtual Hard Disks\DC1.vhdx" -switchname Corpnet


My testing is based off the Server 8 Test Labs (http://social.technet.microsoft.com/wiki/contents/articles/7807.windows-server-2012-beta-test-lab-guides-en-us.aspx) and are going to use multiple Server 8 VMs. To automate multiple builds, I created a function that automates all of the necessary steps.
Function MakeServer8VM($vmName){
New-vhd "e:\vm\Virtual Hard Disks\$vmName.vhdx" -ParentPath e:\vm\template\Server8_template.vhdx -computername HyperTest
new-vm -Name $vmName -ComputerName HyperTest -memorystartupbytes 1073741824 -VHDPath "e:\vm\Virtual Hard Disks\$vmName.vhdx" -switchname Corpnet
start-vm $vmName -computername HyperTest
}


The process is exactly the same for Windows 8, just create another template and update the function to use the new template name.

The only item I havnt yet configured is enabling of Dynamic Memory in the VMs. This allows the VM to only claim the memory it needs, and grow/shrink as needed. The new-vm cmdlet doesn't seem to allow this option, so I am sure it would require an additional step in the function.

Monday, July 30, 2012

Deleting PTR records with Upper Case text

I ran into an issue today where I had a DNS PTR record that I needed to delete, but couldn't. I would delete the record in the GUI without issue, but then I would refresh and the record would reappear.
A little searching and I found http://support.microsoft.com/kb/842127 that talks about a known issue in Server 2003 DNS and upper case text. I am running Server 2008, so I assumed the issue may still exist and hasn't been patched.
However, following the instructions in the KB article and using dnscmd failed to delete the record. I didn't want to try deleting the entire zone (option 2), so I was at a standstill.

A little more searching and I came across  http://www.techtalkz.com/windows-help/66165-unable-delete-static-ptr-record.html, a posting discussing using ADSIEdit.msc to delete the misbehaving record. I deleted the record from AD, but it never cleared from DNS; and after waiting a few minutes, reappeared in AD.
I suddenly had an idea - if the upper case text is causing the problem, maybe ADSIEdit will allow me to edit the text. I copied the dnsRecord attribute from a known good record and overwrote my problem record. A few moments later DNS was updated and reflected the name change. Right-click and delete - the record is gone.

This wasn't an intuitive solution and I hope I don't have to perform it again, but at least I now have the necessary steps to repeat if necessary.

Friday, July 20, 2012

Windows 8 Test Labs

I started playing with Windows 8 and Server 8 to learn about the new technologies and capabilities in them. Since the platforms are fairly new, I was concerned there wasnt much information about the platforms. You can imagine my joy when I came across the following link: http://social.technet.microsoft.com/wiki/contents/articles/7807.windows-server-8-beta-test-lab-guides-en-us.aspx

This page has several test labs with step-by-step instructions on how to setup and configure Server 8 for various tasks. I just completed the Base Configuration lab and created snapshots of all the VMs. Now I am moving on to the DirectAccess labs to learn more about this new'ish technology and how it can help in my production environment.

Monday, July 16, 2012

Completely unsupported method of configuring CommVault clients

I came across an issue that required me to tweak a global policy in my CommVault environment. Basically I needed to turn off client-side compression for my Oracle servers, but I had a problem, how do I disable it on only the target systems when the policy is defined in my Global Dedupe Policy.
CommVault has a built in scripting environment (http://documentation.commvault.com/commvault/release_9_0_0/books_online_1/english_us/features/cli/xml_scripts.htm), but I couldn’t figure out how to report on this setting. And if I can’t validate the setting via script, I am a little wary of making changes via script.

A little bit of searching and I found some settings in the SQL backend. The particular setting “Software Compression” is stored in the table archPipeConfig. This first query shows me that compression setting for my clients.

Show the compression status from all ‘SQL Server’ agents
select ac.name 'Client'
      , ai.name 'Agent'
      , ain.name 'Instance'
      , ap.subclientName 'SubClient'
      , apc.compressWhere
      , case apc.compressWhere
            when 0 then 'Client'
            when 1 then 'Media Agent'
            when 2 then 'Use Storage Policy'
            when 4 then 'Off'
            else 'unknown' end as 'Compress'
from archPipeConfig apc
LEFT JOIN APP_Application ap on apc.appNumber=ap.id
LEFT JOIN APP_Client ac on ap.clientId=ac.id
LEFT JOIN APP_IDAType ai on ap.appTypeId=ai.type
LEFT JOIN APP_InstanceName ain on ap.instance=ain.id
where ai.name='SQL Server'
      --and compressWhere<>0
order by 1, 2, 3, 4


Now the fun part – I am sure this isn’t supported, and I don’t even know if it actually works. The below SQL command will update the compression value on clients based on agent type.
Update compression status on all ‘SQL Server’ agents, set it to ‘Client’
update archPipeConfig set compressWhere=0
where appNumber in (
select ID from APP_Application where appTypeId in
(select TYPE from app_IDaType where name='SQL Server')
)


** UPDATE **
After running through all that work and effort, I found a post to http://documentation.commvault.com/commvault/release_9_0_0/books_online_1/english_us/features/cli/qscripts/CommServ.QS_CompressionConfig.Readme.html that uses qoperation.exe to view and change the compression setting.
Using the examples on the page, I was able to quickly review and set the compression settings on the clients I needed

Friday, July 06, 2012

A powershell image downloader for Reddit

Yes, I know there are a million of these, so this will make one million and one.

This is a image downloader for Reddit. Many of the images on Reddit are simply linked and can be downloaded directly from the XML source. This example configures a web proxy, and downloads from the /r/pics subboard.



# .NET class 
$webClient = new-object System.Net.WebClient 
# specify your proxy address and port 
$proxy = new-object System.Net.WebProxy "proxy.company.com:8080"  
# replace your credential by your domain, username, and pasword 
$proxy.Credentials = New-Object System.Net.NetworkCredential ("Domain\UserName", "Password") 
$webclient.proxy=$proxy  
# specify an header if you want to check info in your logs on your proxy 
$webClient.Headers.Add("user-agent", "Windows Powershell WebClient Header") 
# File to download 
$url = "http://reddit.com/r/pics/.xml" 
[xml]$myxml = $Webclient.Downloadstring($url)
$myxml.rss.channel.item.description.split("<") | %{$_| select-string -pattern link} | %{$webclient.DownloadFile($_.line.split('"')[1],"c:\temp\red\" + $_.line.split('"')[1].split("/")[-1] )}

Found my first problem with vCOps

I setup an eval of vCenter Ops in a test environment about a week ago and was letting it run. This morning I came in and found the below alert in my email:
New alert was generated at Fri Jul 06 05:12:21 PDT 2012:
Info:Object`s demand is 104.0 percent of its available resource capacity. Disk I/O is the most constrained resource.

Alert Type : Health
Alert Sub-Type : Workload
Alert State : Critical
Resource Kind : Datastore
Resource Name : TKPD_T2_J250003_02
Alert ID : 1806

VCOps Server - 10.89.12.104
Alert details


Always concerned about storage performance, I began digging into the VMware performance stats for the datastore and identified ESX host TKJ1721VK as the likely culprit.

There were only 2 VMs on the datastore/host combination: WTSQLSRV2 and WTDPW065C. A quick glance at the perf stats for each VM shows WTSQLSRV2 as the cause. Because this is a SQL server, I am assuming there is a scheduled job on the server that launches at 5am and is causing the CPU/Memory/Disk utilization to spike.
Looking through the other alerts I received this morning, I now see that there were alerts for both the VM WTSQLSRV2 and host TKJ1721VK at approximately the same time.

This is a fairly simple alert to resolve, with the final resolution of tuning SQL and/or moving the VM to dedicated storage. This does show that the vCOps has some merit, though it took a lot more steps to identify the cause than I would have expected.

Thursday, July 05, 2012

Importing EMC SAN data to vCenter Operations

I recently began testing vCenter Operations, and once I got it setup I quickly grew bored. Not because its not a good product, but the normalizing period takes several days/weeks, so there isn't much of an immediate WOW factor.

While waiting, I remembered hearing that EMC was releasing a Storage Analytics pack for vCOps. The solution isnt released yet, but there are several examples of using PowerShell to gather performance data and import it in. A few posts on EMC's community pages (https://community.emc.com/thread/126637https://community.emc.com/thread/130486) give sample scripts to gather information from EMC SANs an import them.


I have a few notes to add here: First off, make sure you are using vCOps Enterprise. The enterprise version allows you to create a custom dashboard (https://vcopsAddr/vcops-custom), which is required to use non-VMware data sources. 
Second, for an EMC SAN there are 2 scripts you run - 1 for gathering perf data, and 1 for creating parent/child relationships of the SP/RG/LUN/Disk. The first script will gather and import the performance data continuously. Once it has posted data once, you need to stop it and run the second script. Once the second script is complete, restart the first.
Third, the relationships associate the discreet SAN components, but not the SAN as a whole. To group all the disks as part of the same SAN, you have to create an application Environment | Applications Overview | Add new application. Then you create the Tiers and associate the resources  in the tiers. A slightly more manual process than it should be, but it works.
Fourth, you have to create your own dashboards. There are so many options available, and their operations/interactions are unique so it takes a bit to understand what you are getting.


So far I have been running the scripts as-is for a few days and am fairly impressed with vCOps handling of them. I am still trying to fully understand the product and understand what I am seeing represented, but so far it looks good.

Friday, June 22, 2012

Pictures from Honduras

The team leader from our Honduras trip put together a slideshow of the trip. While it has been a while, better late than never...

Free online courses: Intro to Statistics

In my day-to-day life as a computer geek, I find myself surrounded by information. For better or worse, it is my job to try an take this data and make intelligent decisions based on it. To be quite honest, I have been fumbling with how to organize and use the data. Between high-school statistics class and various blogs I have been somewhat successful, but there is something to be said for a structured educational process.

Today I came across a course by Udacity (http://www.udacity.com) that may be just what I am looking for. The course - Intro to Statistics - uses information to visualize data and make intelligent decisions based on it. The class starts on the 25th, so I shouldn't have to wait long to begin using it.


Wednesday, June 20, 2012

Configuring syslog in ESX

It happens every time - an error occurs in VMware, and causes a lot of VMotions. By the time you get the logs off the ESX host, they have rolled off and are no longer valid.

To combat this, we setup a syslog server for all our ESX hosts to report into. To configure the hosts, you either configure each system manually, or you can use the Set-vmHostSyslogServer powershell command. The following command will set all ESX hosts in your datacenter to report to the same syslog server.
get-datacenter "My Datacenter" | get-vmhost | set-vmhostsyslogserver -syslogserver syslog.domain.com:514


When your done, use the following command to confirm everything is configured correctly.
get-datacenter "My Datacenter" | get-vmhost | get-vmhostsyslogserver

Wednesday, June 13, 2012

Finding VM disk details in powershell

Occasionally I have to do some VMware datastore maintenance (remove datastores, migrate SANs, etc...) that requires me to move VMs from one DS to another. Traditionally this should be simple: find all VMs on a DS, sVmotion the VMs to a target DS, and remove the original. To make it easier, I rename the datastores as DontUse_XXXX, to easily identify which ones I am clearing, and to keep others from adding VMs to them.
In vSphere 5 this gets even easier: put the DS into maintenance mode and the VMs are migrated automatically.

To complicate things, we have some VMs that are on shared datastores, some that are on dedicated datastores (such as databases), and some that are on both. This means I can't arbitrarily migrate VMs from 1 DS to another DS. If I did this, then database servers would be moved from dedicated RAID 10 LUNs to shared disks without any guaranteed performance.

The first major step is to identify what VMs I have, and how I need to move them. The below powershell script will query all VMs on my DontUse datastores and return the VM name, total size in GB, number of disks, and number of DataStores the VM is on.



get-vm -datastore dontuse* | select Name, @{name="GB";expression={($_ | get-harddisk | Measure-Object -prop CapacityKB -sum).sum /1024/1024}}, @{name="disks";expression={($_ | get-harddisk | measure-object ).count}}, @{name="DS";expression={($_ | get-harddisk| %{($_.filename -split " ")[0]} | sort-object | get-unique).count}}


This quickly alerts me to any VMs I can migrate without issue, and which ones to look deeper into prior to migrating

Tuesday, May 22, 2012

Getting the last powered on time of a VM

I have been going through our VMware infrastructure and cleaning up the storage and found a large number of VMs that were powered off. I wanted to know if any activity had happened on them recently to see if they were still valid. A little googling and I found the below script that will look through the event logs of Virtual Center and tell you when it was last powered on.


Monday, May 14, 2012

Create a VMFS datastore via powershell

Due to limitations in ESX4, I recently needed to create several 2TB VMFS volumes. I can easily automate this on the SAN configuration, but creating the VMFS datastores has always been a manual process. I came across sample code at http://snipplr.com/view.php?codeview&id=48048 that showed how to perform this via powershell.

I modified it a bit to work in my environment and posted the code below
Syntax to run: New-DatastoreByLun “myESXHost” “SANB” 9 0 “Datastore01”



Wednesday, May 02, 2012

Setting VMware Reservations and Limits via PowerShell

I am looking into the possibility of implementing tiering and limiting within my VM infrastructure. Nothing special is required, but I want to make sure that a development system doesn't run rampant and impact production. I came up with this script to adjust the CPU/RAM reservations/limits based on the number of CPUs and amount of RAM assigned.



Tuesday, May 01, 2012

Removing disk from a Celerra

This isn't a task that is often done, and normally not suggested to be done without EMC support. I have done this a few times, but only when the system is entirely cleared and there is no possibility of breaking things.

Step 1: Remove all mounts and file systems in the Celerra web UI
This is the opposite of creating the file systems and mounts, it should be self explanatory

Step 2: List the disk status
Using putty or other SSH client, log into the Celerra as nasadmin
Type nas_disk -l, this will give a listing of the disks, their type, and status. The disks where inuse=n can be safely removed

Step 3: Delete the disks
Now that we have the disks that can be removed, remove them by typing nas_disk -d [disk name] -perm
Another nas_disk -l will confirm the disk has been removed

Step 4: Delete the LUNs
Once the disks have been removed, log into Unisphere and view the LUNs exported to the Celerra. The name of the deleted LUNs will revert the the standard LUN XXX nomenclature. These LUNs can now be removed and deleted.


WARNING! If you do this wrong you risk corrupting all data on your Celerra. Don't do this unless you absolutely know what your doing, or there isn't any data to lose.

Thursday, April 26, 2012

HTTP redirect in IIS6

When you install a web app, it often times installs to a virtual directory, which means that instead of browsing to http://server, you have to browse to http://server/app. It used to be that I would simply setup a META redirect in the default.html page to redirect the browser, I learned today that isnt the optimal method, nor does it always work.
As I was setting up a redirect for a site, I found that some browsers worked and some didnt. Also, the security settings appear to impact the types of redirections (relative or absolute) that are allowed. A little googling and I found http://exchange.mvps.org/owaredirect_frames.htm. This is for IIS5/6, and it is a little easier in IIS7.

Gratuitously copied and pasted below in case the content gets retired.

How do I redirect the default web site to /exchange ?

1. Log onto the OWA server
2. Open the IIS Manager
3. Open the properties for the default web site
4. Under the Home Directory Tab, do the following
a) Choose redirection to a url
b) Type /exchange in the text box
c) Check the "directory under this one" radio button
5. Click "apply", "OK", and exit the IIS manager.
6. Test the changes by opening a web browser, and connecting to the www root folder.  It should now take you directly to the Exchange Logon screen.


Monday, April 23, 2012

My take on the recent Vision Trip to Honduras



To properly describe my recent trip to Honduras, I first have to start by detailing my trip last year. Last year we had a work trip, with the goal of helping out at the school and doing some sort of work project. The project we were involved in was helping to build a house. There were over 20 of us that went: men, women, and children, all together in a school bus.
Every day the school bus would drop us off at AFE in the morning, and then I and 2 other men would travel to the work site where we worked closely with a handful of locals. None of us from the states were particularly skilled in construction, so we easily took direction from the foreman and other locals. As expected we ran into translation issues, but the scope of our work was somewhat limited, so it was easy to manage. After the morning was done, we would travel back to the school for lunch, then back to the house for a few more hours. When the day was done we went to the hotel and cleaned up and got ready for dinner.
During our few days there, we were able to get an amazing amount of work accomplished. Even though we didn’t make it a goal to accomplish so much, in 1 week we took a concrete slab and made it a fully functional house with 2 bedrooms and a kitchen/living space. It felt great to accomplish so much and know that a deserving family would benefit greatly from our efforts.
After I got home and the post-mission trip glow faded, I began wondering if I really helped by going down there. Surely the locals could have completed the job just as well, and the cost of my travel, hotel, and food could have provided better tools that would have made the job easier and faster. Additionally, everyone else in our group kept talking about how great it was to connect with the kids and how much they look forward to seeing them again. All I ever saw was the work crew, they were great guys, but I wouldn’t go out of my way to see them again.
I spoke with Pastor Rey about what I could truly help with and he suggested that I would be able to help people in the dump community just by being there. Being involved in Bible studies, helping the kids, and just being friends was the most important things I could do.

Once the discussion for a new trip came up I decided that if I go, I would focus on being with the kids, not on building something. I would still build if needed, but it wouldn’t be my primary goal. I was delighted when I heard that this wasn’t going to be a Mission Trip, or a Work Trip, but rather a Vision Trip. We weren’t going to focus on how much we can get done, but on making friends and sharing of ourselves. I was in…
So when asked what I “accomplished” during this trip, all I can say is that I painted a couple of windows, something that could easily be accomplished in an 8 hour day, not 12 people over 6 days. The real question is who did I impact, and I think that would be a couple hundred kids. Just by playing with them, being friends with them, and being there I made their lives a little better, and possibly changed them permanently for the long run.
I was personally impacted by how open the kids at AFE were and how open they were to me as a stranger. Minutes after arriving on campus we went to the auditorium and I sat down in the crowd, immediately a boy named Wilson scooted over to me, grabbed my hand, and held onto it. He didn’t want me to entertain him, he didn’t need me to teach him, or be anything special, he simply wanted me to love him. Even though I don’t know him, speak his language, look like him, have any candy, or anything else, he wanted me. As the week went by, similar situations happened with different kids, while playing, taking pictures, or just sitting in the shade, I was amazing how open their hearts were to allowing a gringo into their lives.

One of my favorite quotes is from the movie Return of the Jedi, “You're going to find that many of the truths we cling to depend greatly on our own point of view”. While at AFE and the surrounding dump community I found lots of great people, lots of resources, and lots of beauty, but I also found a point of view that was, for lack of a better term, stuck. During this trip I learned how just a few well-chosen words to a child can possibly change a point of view, or at least open them to another point of view. Now I understand what Pastor Rey meant by saying that being there was one of the most important things I could do.
Now I am looking forward to our next trip. The only concern I have now is how much time I am able to spend there. Between work schedules, and the schedules of the rest of the team, I may only succeed in getting to spend 1 week a year. If this were an ideal world, I would be able to take a 3 month sabbatical and spend more time getting to know the people there, and of course learn how to speak with them


Cross posted to http://blog.edgoad.com and http://wcafe2012.blogspot.com/

Wednesday, April 11, 2012

Change storage pathing in ESX5

In ESX4 I used a script to cycle through the available datastore paths and set the connection type to round robin. In ESX5 it changed a bit, so this is the updated script





param([string] $server = $(throw "Server param required")
,$user,$pass)

if ($user -eq $null)
{connect-viserver $server}
else
{connect-viserver $server -User $user -Password $pass}

$esxcli = Get-EsxCli
$esxcli.storage.nmp.path.list() | group-Object -Property Device | where {$_.count -ge 4} |  %{ $esxcli.storage.nmp.device.set($null, $_.Name, "VMW_PSP_RR")}
$esxcli.storage.nmp.satp.set($null, "VMW_PSP_RR", "VMW_SATP_ALUA_CX")

disconnect-viserver $server -confirm:$false

Thursday, April 05, 2012

Automating multiple RedGate restores

I recently had the task to do a DR restore several SQL databases using RedGate backup software. The software is incredible and does things very well, but I had to restore 3 servers each with dozens of databases - not something to be done by hand. Here are a few tricks I learned during the process.

Getting the server ready:
This was a DR restore, so I had the server, file system, and system state, but no active SQL databases. The first step was to get SQL running and restore the MASTER database. To get SQL running I built out a VM and setup a vanilla install of SQL. I then copied the master, model, dist, msdb, mssqlsystemresource, and temp databases. SQL then started successfully.
Once SQL was running, I restored MASTER. Start SQL in single user mode (sqlservr -m -c) and use RedGate's sqlbackupc.exe command as shown below:
    sqlbackupc -sql "restore database master from disk='path' with replace"

Taking databases offline:
Because the databases dont already exist, we need to take them offline prior to being able to restore. This can be done manually, right-click database | Tasks | Take Offline, but for dozens of DBs, there has to be a better option.
I ended up creating the TSQL script below, then cut and paste the results into another query.
    select 'alter database [' + name + '] set offline with rollback immediate' from sys.databases

Restoring databases:
Now the fun of restoring the databases. All the files were stored on a remote share, and using a similar process to taking the DBs offline, I was able to automate the restores. This time copy and paste the results into a command window with pathing to the RedGate tools
    select 'sqlbackups -sql "RESTORE DATABASE ' + name + ' FROM DISK=' +''''+ '\\server\directory\*.sqb' +''''+ ' WITH REPLACE"' from sys.databases

Once restored, the databases come back online automatically

Monday, March 26, 2012

Zoning a Brocade switch via command line

I recently found that I will need to create several zones on a brocade FC switch. Normally I use the Java GUI as this is easy and simple to visualize the changes, but with approximately 120 zones to create, the GUI is out of the question.

A little bit of searching and I found some great blogs discussing just this - creating FC zones from command line.
http://cosonok.blogspot.com/2011/12/brocade-switch-cli-zoning-configuration.html
http://www.sanduel.com/SAN-Storage-Commands/How-to-zone-a-Brocade-SAN-switch-in-command-line-base.html

One thing to note is that many of the commands (such as alicreate) can support multiple members. This means you can have multiple WWNs added to a single alias via a single command. To see which commands support multiple members, use the help command - ex: help alicreate

Thursday, March 08, 2012

Site-to-Site VPN using Vyatta

I was testing a new backup solution that does replication across the wire to a secondary site. I didnt want to impact production, so I used VMware to clone the system I was backing up, and used an isolated network for my backup testing.
All was fine until I needed to setup a target at my second site, and still remain isolated. I needed to use a unique IP scheme, yet still have it routed across our WAN. All without having to nag the network team for my test environment.

Enter Vyatta router. Using it I was able to bridge my isolated network to the outside world, now I was able to download and install updates from the internet. I then found a post at http://www.arkf.net/blog/?p=231 that discussed using Vyatta as a site-to-site VPN. I followed through the steps and BAM, everything was connected.

Friday, February 03, 2012

Using CommVault 1-touch restore

I have been attempting on and off for a few weeks to get CommVault's "Virtualize Me" feature working in my environment. My environment is a little unique in the fact that the DR VMware systems are isolated from the CommServe. Because the CommServe needs access to Virtual Center to use Virtualize Me, there is a problem. We looked at differnt options such as moving servers and creating static NAT rules, but none of them were very flexible or secure.

A little searching and I found a great post about CommVault 1-Touch. Virtualize Me is essentially 1-Touch, but automated for VMware deployments. The benefit of 1-Touch is that it is used to restore to any system, not just VMware.

To use 1-Touch you have to pre-create and configure the VM hardware (CPU, RAM, disk, network, etc...) Then boot to the ISO and walk through the setup process..

Step-by-step recovery processes can be found at http://blog.lewan.com/2011/12/04/commvault-1-touch-bare-metal-restore-to-vmware-vm/

Another method to extract music from YouTube

Previously I created a post that described how to extract music from YouTube using a variety of Linux tools. I am getting ready for a road-trip and needed some theme music (Mustang Sally, Slow Ride, etc...), but didnt have a Linux system available. So here is another method using Windows tools.

DISCLAIMER: I am not fully aware of the legality of this. I am assuming that it is OK since I am not doing any hacking or breaking of cryptography, but your mileage may vary.

Tools needed

Step 1: Find the video you want
This is the easy part, just search YouTube for the video you want. 
It may be a good idea to listen to it before hand to ensure it is the version you want. There are a lot of remixes and covers by other bands (professional or otherwise). You wouldn't want to download a heavy metal song and find out later that its a polka remix

Step 2: Download the video
Use Free YouTube Download to download the video to your computer. I found the default quality and format settings to work fine.

Step 3: Extract the audio

Using VLC, walk through the Convert process to extract the music as an MP3.
If you have a lot of files, you can use the following command to bulk convert them.
for %i in (*.mp4) do "c:\program files\videolan\vlc\vlc.exe" "%i" --sout #transcode{acodec=mp3}:duplicate{dst=std{access=file,mux=raw,dst=\""%i.mp3"\"},select=\"novideo\"} vlc://quit

Wednesday, February 01, 2012

Monitoring wireless networks

I just rebuilt my laptop and was in the process of reinstalling all my normal tools (7zip, Chrome, wireshark, etc...) I suddenly remembered that I had a great wireless monitoring tool that allowed me to see what networks were nearby, what channel they were on, and how strong their signals were over time, but I couldn't remember its name.

A little googling and I found it - inSSIDer (http://www.metageek.net/products/inssider/).

The really great thing however, is that I found several other methods to do the same thing. For my Android phone there is WiFi Analyzer (http://a.farproc.com/wifi-analyzer), and Windows can even perform similar tasks natively by running netsh wlan show networks mode=bssid

Tuesday, January 24, 2012

Uploading to WebDAV using powershell

Its not commonly used, but I find WebDAV to be one of the more useful file transfer methods on the internet. It is secure (as secure as SSL can be), it can be accessed via web browsers, and drives can be mapped to it.
The only problem is that (under Windows) it is normally access by a user profile, and not the entire system. This can be a problem if you are trying to automate copy jobs or backups to the WebDAV share.

I found a great post at http://www.vnext.be/2010/05/20/powershell-upload-file-to-webdav-server/, that shows how to use PowerShell to copy to WebDAV. Its not an entirely elegant solution, but it can be scripted and user/password credentials can be stored to allow automated tasks to access it.



Thursday, January 19, 2012

Importing VMware flat.vmdk file

Someone sent me a file today and told me to import it into VMware. I looked at it briefly and noticed that it was a single file named server-flat.vmdk.
Normally VMware uses multiple files, a VMX, a VMDK, and a -FLAT.VMDK, but here I was just given the one. The FLAT file contains all the disk, so this was the most important file. But the other files are descriptors that tell VMware how to use the disk - What OS, what controller, disk geometry, etc...

A little googling and I found my solution at http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1002511. The basic steps are below:

  1. Import the VMDK file to a datastore
  2. Create a VM with the OS and RAM characteristics needed - dont create/attach a disk
  3. Putty to an ESX host
  4. Find the datastore the VMDK was imported into and do an LS -LA to view the file size in bytes
  5. In the VM folder, run  vmkfstools -c 4294967296 -a lsilogic -d thin temp.vmdk
    1. The size, name, and controller type will vary
  6. Delete the new -FLAT.VMDK file
  7. Move the original -FLAT.VMDK file into this folder
  8. Add the newly created VMDK to the VM

Tuesday, January 17, 2012

SVmotion individual harddisks via PowerShell

I ran into an issue today where I wanted to SVmotion several large virtual disks to different datastores. I didnt want to use the VC because I would either have to 1) Kick off all migrations at the same time, or 2) wait and watch for each disk to finish before launching the next migration.

I knew I could move the whole VM using Powershell, and then I came across this link: http://mrpointy.wordpress.com/2011/07/05/storage-vmotion-only-one-harddisk-via-powershell/. This shows how to identify a single disk and move it to a separate datastore. Queue up these commands in notepad and then past them into PS and they will automatically launch one after the other. Below is an example command


get-harddisk -vm cvmedia51 | where {$_.Name -eq "Hard disk 3"} | % {set-harddisk -harddisk $_ -Datastore TKPD_T3_L070001_02 -Confirm:$false}