Notes about interesting problems that I've come across and their solutions. Focused on Virtualization and the accompanying technologies that make it all possible!
2017 vExpert
Get link
Facebook
X
Pinterest
Email
Other Apps
I'm proud to announce that I've been selected as a 2017 vExpert! Thanks for the recognition and congrats to all of the other vExperts, particularly my coworkers Jeff and Dennis!
One of my customers is standardizing the configurations on their HP C7000 enclosures (they've been set up at various sites by various administrators with varying involvement from the architecture team). As such, we need to stand up some temporary resources so that we can take down the main enclosure for reconfiguration. That's fine, we can easily ship a smaller enclosure to each site for temporary compute resources. Some of the sites are using Standard vSwitches, so we need to be able to quickly copy the networking configuration over from their existing blades to these new, slightly different blades. As I see it, we had 2 good options: 1) Capture a Host Profile with the desired vSwitch configuration. Delete every other component of the Host Profile so that only the networking section is applied; design the new ESXi hosts so that the vSwitches'll work with the old vmnic-to-vswitch configurations. 2) Write a script to clone the vSwitch from ones ESXi host...
PowerShell's Sort-Object cmdlet is super useful, especially when preparing output for human consumption. A few people have found my blog while looking for more information about its use, specifically while looking for how to sort by multiple columns (well, properties, technically). I've never done so (much less written about it), so I hope those folks found answers elsewhere. But, it got me curious... and it turns out that it's really easy. The Technet article on Sort-Object has the answer directly spelled out: just use commas to create a list of properties to sort by (in order to precedence). Let's look at some examples! First, prepare a variable with some good sortable data: $myData = get-eventlog System -newest 25 And then we can get to sorting! Say you want to sort primarily by EntryType (Warning, Information, Error) and then by Source. Easy-peasy: $myData | sort EntryType,Source How about if you want it to be in descending or...
I've recently been playing around with the -RunAsync parameter in some of my PowerCLI scripts, and I'm super impressed! I'm also super late to the party; I mean, LucD was writing about it back in 2010, but still! So, what's it do? It speeds up tasks that don't need to be run sequentially, that's what it does. For example, if I have a list of VMs that all need to move into a new folder, I could do it like this: $folder = get - folder "New Folder" $vmNames = get - content MyList.txt foreach ($vmname in $vmNames){ get - vm $vmname | move - vm - destination $folder } And that would move one VM, then the next, then the next, etc. Depending on the number of VMs, it could take a real long time. This process could take a while because, the way this script is written, the system will wait for each "move" to complete before initiating the next. That's where -RunAsync comes in. $folder = get - folder "New Folder" ...
Comments
Post a Comment
Sorry guys, I've been getting a lot of spam recently, so I've had to turn on comment moderation. I'll do my best to moderate them swiftly after they're submitted,