EnterpriseAdmins.orghttp://enterpriseadmins.org/blog
Random topics in Virtualization and Systems AdministrationMon, 29 Dec 2014 15:15:43 +0000en-UShourly1http://wordpress.org/?v=4.2.3A missing folder, a missing dayhttp://enterpriseadmins.org/blog/scripting/a-missing-folder-a-missing-day/
http://enterpriseadmins.org/blog/scripting/a-missing-folder-a-missing-day/#commentsMon, 29 Dec 2014 15:15:43 +0000http://enterpriseadmins.org/blog/?p=1342I recently moved some scheduled tasks from a Windows 2008R2 server to a Windows 2012R2 server. This should be the easy type of work: copy some files, enter some credentials, move on to another project. But as luck would have it, An exception occurred. Those three words.

One of the scheduled tasks uses a COM object to access Visio.Application. The script enumerates a listing of Visio diagrams, sees if they are newer than a static version on a web server and if so runs SaveAsWeb for each new document. After moving to a new server the ‘An exception occurred.’ error kept showing up for each document being published when the script ran as a scheduled task. Running the script interactively worked fine. A bunch of searching kept pointing at dcomcnfg, specifically for an entry named Visio Document and/or Microsoft Office Visio Document. This option did not show up for me. I even re-installed Visio and rebooted hoping to re-register the COM object. When I was just about ready to give up, I found this simple article, with a comment all the way at the end:

You need to ensure that the folder C:\Windows\System32\config\systemprofile\Desktop exists. It’s the same when you try to automate Word in a service.

Could it really be that simple? Would creating one folder solve the day long project? The answer — yes. I browsed to C:\Windows\System32\config\systemprofile and created a folder named Desktop. The scheduled task now works fine on the new server. One missing folder, one missing day in troubleshooting a simple task.

]]>http://enterpriseadmins.org/blog/scripting/a-missing-folder-a-missing-day/feed/0Moving to XtremIO (or any other array)http://enterpriseadmins.org/blog/scripting/moving-to-xtremio-or-any-other-array/
http://enterpriseadmins.org/blog/scripting/moving-to-xtremio-or-any-other-array/#commentsMon, 28 Apr 2014 13:00:43 +0000http://enterpriseadmins.org/blog/?p=1332I was recently asked to help move VMs from one datastore backed by traditional spinning disk to an EMC XtremIO datastore. I was really excited as I wanted to see the power of an all flash array.

As a best practice, most all flash vendors recommend using their own multipathing software (PowerPath/VE) or round robin. In this environment, the customer choose to go with RoundRobin. This is pretty easy to do in the GUI, but you need to do it for each device and on each host in a cluster. Not to worry, PowerCLI is willing to help. The following code will find all XtremIO LUNs not currently set to RoundRobin and change them.

Once we have the new datastores all prepared and ready to go, we can start moving virtual machines. In the customers environment, two different clusters of ESXi hosts shared a common set of datastores. As part of this migration, the customer wanted to dedicated datastores to each cluster (removing their cross cluster datastores). Again, PowerCLI was willing to help. In the following code, we will move all of the virtual machines from MyOldDataStore that are on a host whose name matches esx-cl3. We will sort the virtual machines by name, just for tracking purposes and kick out an email when the process is complete (just so we don’t have to babysit the process):

That was pretty easy, and now the VMs will benefit from the consistent low-latency of an all flash array. Now you probably need some help managing and monitoring your array. Fortunately the team over at vNugglets have you covered. Check out their latest post at http://www.vnugglets.com/2014/04/xtremio-powershell-module-report-on.html. It is a fantastic module and really worth checking out.

]]>http://enterpriseadmins.org/blog/scripting/moving-to-xtremio-or-any-other-array/feed/0Lack of postshttp://enterpriseadmins.org/blog/scripting/lack-of-posts/
http://enterpriseadmins.org/blog/scripting/lack-of-posts/#commentsMon, 28 Apr 2014 01:00:18 +0000http://enterpriseadmins.org/blog/?p=1336I realized today that I hadn’t posted anything new since December. That’s four full months without a post… normally I would have averaged a dozen posts in this period of time. A few things have contributed to to this lack of posting.

Working on projects that really lack code worth sharing. There were a few tips/tricks I picked up specifically around making graphical user interfaces with SAPIEN PowerShell Studio (that I plan to share soon) but overall the projects focused on solving very specific problems that don’t share well.

Book reviews. I had the opportunity to review several vSphere related books for Packt Publishing. This was an interesting project, but consumed some of the free time I used for blogging. I plan on posting reviews of these books soon.

A career change. I accepted a promotion from a technical to managerial role. This has been more of a change that I had anticipated and adjusting to the new demands has consumed some time.

Anyway, enough with excuses. I have a few post ideas lined up and hope to have them out the door in the next few weeks. Check back soon!

]]>http://enterpriseadmins.org/blog/scripting/lack-of-posts/feed/0Migration to Office 365/Exchange Onlinehttp://enterpriseadmins.org/blog/scripting/migration-to-office-365exchange-online/
http://enterpriseadmins.org/blog/scripting/migration-to-office-365exchange-online/#commentsMon, 30 Dec 2013 14:00:20 +0000http://enterpriseadmins.org/blog/?p=1327I recently had a chance to help a small business move their 70 mailboxes to the Exchange Online service. This company was running Windows 2008 with Exchange 2007 on premises installation and we helped them migrate to Office 365/Exchange Online over a couple weekends. During the migration we ran into several issues. I couldn’t find many online resources where people documented these errors, so I wanted to write them down on this site.

Issue #1Symptoms:
Outlook Anywhere (RPC over HTTPS) service was configured, running and available to end users. However we received various errors when trying to establish a migration endpoint. Even though the service was working, the Remote Connectivity Analyzer (https://testconnectivity.microsoft.com/) was failing on Outlook Anywhere tests.Resolution:
Looking around online, we thought the issue was related to the Exchange 2007 service pack level, so we upgraded to SP3. I’m not sure if this actually helped, but I figured it was worth mentioning as it may have fixed other issues we could have seen during the migration. The actual fix for this issue (and unfortunately I can’t find the Office 365 communities post where we found the suggestion) was to create a hosts file entry on the exchange server containing the IP, server name and FQDN of the internal Exchange server name. DNS was working perfectly, so I’m not sure why this was needed. However, after the entry was added the Remote Connectivity Analyzer tests started working and we were able to move forward with the migration.

Issue #2Symptoms:
Batch loaded into Office 365 environment to begin migration, but after several hours the task fails
Error log may mention “MigrationPermanentException: Error: MapiExceptionLogonFailed: Unable to make connection to the server”Resolution:
Verify permissions, specifically Receive-As rights to the database (http://community.office365.com/en-us/forums/158/t/18911.aspx).

Issue #3Symptoms:
When opening Outlook as a user when the PC is joined to the domain, the on premises mailbox is opened instead of the Office 365 mailbox. When using a non-domain joined test PC, the Office 365 mailbox was opened.Resolution:
This was caused by the way Exchange handles autodiscover. You can read more about the process here: http://msdn.microsoft.com/en-us/library/office/jj900169(v=exchg.150).aspx. We found a pair of scripts (ExportO365UserInfo.ps1 and Exchange2007MBtoMEU.ps1) available here: http://community.office365.com/en-us/wikis/exchange/845.aspx which allow you to convert the users active directory account into a mail enabled user that references Office 365 instead of a mailbox user in the on premises install.

This was my first experience with Office 365/Exchange Online. I was surprised at how complicated some of the migration steps were. With the whole ‘cloud-based’ self service model, I assumed that the migration path would be just a few clicks. With the handful of lessons learned from going through this process once, I would feel more comfortable doing another migration (but its not something I would volunteer for). I hope someone finds this post helpful.

]]>http://enterpriseadmins.org/blog/scripting/migration-to-office-365exchange-online/feed/2PowerCLI: Getting LUN paths when using EMC PowerPath/VEhttp://enterpriseadmins.org/blog/scripting/powercli-getting-lun-paths-when-using-emc-powerpathve/
http://enterpriseadmins.org/blog/scripting/powercli-getting-lun-paths-when-using-emc-powerpathve/#commentsMon, 09 Dec 2013 15:30:00 +0000http://enterpriseadmins.org/blog/?p=1324A few weeks back I wanted to verify some path counts per LUN. This is typically pretty easy and something that can be written as a one liner using standard PowerCLI cmdlets as such:

Get-VMHost | Get-ScsiLun | Get-ScsiLunPath

However, the above command wouldn’t return results in the customer environment. After doing some testing, I realized that the issue was likely related to the presence of EMC PowerPath/VE for multipathing on the hosts. When using the GUI to view storage/LUN properties other details like Path Selection Plugin (PSP) is also missing… but the path information I wanted was still available. It took a little bit of poking around in the Get-View output, but I was able to come up with something to get me the data I was looking for. Its not real pretty, but it is fast and helped me answer a couple questions. I figured I would share the code here here in case anyone else runs into this issue. If you have any comments/suggestions on how to make this code better/more complete please post them in the comments section.

]]>http://enterpriseadmins.org/blog/scripting/powercli-getting-lun-paths-when-using-emc-powerpathve/feed/0Getting data out of vCOpshttp://enterpriseadmins.org/blog/scripting/getting-data-out-of-vcops/
http://enterpriseadmins.org/blog/scripting/getting-data-out-of-vcops/#commentsThu, 03 Oct 2013 14:00:10 +0000http://enterpriseadmins.org/blog/?p=1315I’ve been troubleshooting a specific problem where storage latency jumps very high during very short periods of time, usually in the late evening/very early morning hours. The latency is very bad, sometimes in the 2,000ms+ neighborhood. My storage guys see an extreme increase in IOPS coming from my ESXi hosts just before the latency comes into play. The working thought was several VMs were kicking off some type of disk intensive batch job around the same time. This would be a perfect use of the vCOps troubleshooting Top N charts, but the issue doesn’t appear every day and is typically resolved before anyone noticed. Since the Top N charts are realtime they are not super useful in this situation.

What I needed was a way to export which VMs were contributing high IO around the time of the poor latency. Clicking around in vCOps I couldn’t find a way to get this data. (Side note: if anyone knows a good way to do this, please leave a comment.) However, a co-worker pointed me at an unofficial vCOps powershell module available here: http://velemental.com/2012/09/04/unofficial-vmware-vcenter-operations-powershell-module/. Using this module, I was able to get all the data points for disk commands by virtual machine during the time period in questions. With a little where-object goodness we can find only those VMs with over 300 IOPS. Looking at the data before applying this filter, I noticed this value would be around 3x the average IO normally seen during this period of time. This isn’t really a good visualization for the amount of data, but it can give me what I need to be able to continue to troubleshoot:

In my case, this method didn’t give me an obvious answer to my problems. However, it did give me a smaller list of virtual machines to focus on.

]]>http://enterpriseadmins.org/blog/scripting/getting-data-out-of-vcops/feed/1Resize Guest System Partition with PowerCLIhttp://enterpriseadmins.org/blog/scripting/resize-guest-system-partition-with-powercli/
http://enterpriseadmins.org/blog/scripting/resize-guest-system-partition-with-powercli/#commentsFri, 27 Sep 2013 14:30:24 +0000http://enterpriseadmins.org/blog/?p=1313I recently needed to resize system partitions on several Windows 2008R2 virtual machines. To do this with Set-HardDisk the virtual machines must be powered off and you need a helper VM. I was looking for a way to do this without downtime, as that can be arranged when executing the steps manually (grow the disk, log into the guest, rescan disks and then extend the partition). I came up with the following workaround and thought it would be worth sharing. The idea is to set the hard disk to the new size with Set-HardDisk and then use Invoke-VMScript to run diskpart from within the VM. I included the -ResizeGuestPartition switch on Set-HardDisk as that appears to complete the task of re-scanning for disks within disk manager.

I’ve been working on a little side project recently — reviewing a book for Packt Publishing. This process has given me a new respect for authors and the process behind writing a book. The book – vSphere High Performance Cookbook – has been published and you can check it out here: http://bit.ly/14sDuyk.

]]>http://enterpriseadmins.org/blog/virtualization/vsphere-high-performance-cookbook/feed/0Script to ping a list of computer nameshttp://enterpriseadmins.org/blog/scripting/script-to-ping-a-list-of-computer-names/
http://enterpriseadmins.org/blog/scripting/script-to-ping-a-list-of-computer-names/#commentsSat, 31 Aug 2013 19:00:45 +0000http://enterpriseadmins.org/blog/?p=1301A few weeks ago, I co-worker asked for a script to ping a list of computer names. I thought I had one on my blog, but couldn’t find it. I decided to post a copy here to make it easier to find in the future. This is very simple, and doesn’t do any sort of multithreading, but for a short list it will get the job done pretty quick:

]]>http://enterpriseadmins.org/blog/scripting/script-to-ping-a-list-of-computer-names/feed/0Reviewing DNS logs with PowerShellhttp://enterpriseadmins.org/blog/scripting/reviewing-dns-logs-with-powershell/
http://enterpriseadmins.org/blog/scripting/reviewing-dns-logs-with-powershell/#commentsSat, 06 Jul 2013 18:45:55 +0000http://enterpriseadmins.org/blog/?p=1285I recently helped out on a project where DNS services were being moved to different hosts with new IP addresses. After updating the DHCP scope options and static DNS configuration settings on all servers, the team turned on DNS logging to look for any hosts still using the old DNS servers. The logs contained a lot more records than originally anticipated, so I wrote the following code to help summarize the logs.

This first block of code found all of the DNS queries that didnt come from domain controllers, manipulated the log file entry to get just the source IP and stored all the results in a collection named myResults.

Once we rearranged the data so that it would be more usable, we wanted to find the source IP addresses responsible for the majority of the lookups. The idea here is that once you resolve the issue with these hosts, you can recreate the DNS log file and the next pass through will contain fewer entries and therefor run faster. Using powershell this is a pretty quick one liner after you run the block of code above.

That is helpful, but the team really wanted to know host name. Using the data from host naming convention, they could tell what team would be responsible for resolution of the issue. With just a few more lines of code we can easily return that information too.

12345678910

# Since server guys are more likely to know host names than IP address, we will loop through the resutls and# lookup the host name, then sort the list to find the largest number of lookups$myResults|Group-Object-Property SourceIP |Sort-Object Count -Descending|%{$sourceName= try {[system.net.dns]::GetHostByAddress($_.Name).HostName } catch {"UNKNOWN"}New-Object psobject -property@{
HostName =$sourceName
IP =$_.Name
Count =$_.Count}}