Categories
Home Lab PowerCLI Starwind Virtual SAN Virtualization Vmware

Home Lab 2.0 – Starwind VSAN : The Greatest addition to my Home Lab

At the end of my previous post about The Beast I mentioned about lacking shared storage for my Virtual Hosts. My first thought was to go out and purchase a NAS like a Synology or a QNAP NAS. However I am trying to do this on the cheap and an extra $1200 when figuring in the cost of drives is just not in my budget. Now I am not sure about Synology, but I believe that they are comparable to QNAP in the sense that you can present disks as iSCSI LUN. Which I have done several times in the past and works brilliantly.

So here I am sitting in my office looking at the Beast and I was racking my brain trying to figure out what I can do with all this storage in this one box and how I can share it among my Virtual Hosts. I started looking at FreeNAS and running it as a VM in VMware Workstation and that worked! Until I had a power failure and the virtual disks became corrupted and I could not get them to come back online. Very Frustrating, my search continued.

Anyway, after doing some research I discovered Starwind VSAN. It allows you to take storage on a Windows machine and present it as an iSCSI LUN. I thought this is great and I signed up for a trial which gives you the ability to install it on one host but no graphical interface (it uses PowerShell) but unlimited LUNs. After some quick googling about the syntax I was able t piece together the commands with relative ease. Within a few minutes I was up an running with three new iSCSI LUNs and they were mounted in vCenter.

I mentioned earlier about having issues with FreeNAS and power failures, well ironically we had a power failure but Starwind VSAN came back online without a hitch. I was very impressed with how resilient it was. I have not had the chance to really put it through it’s paces, but so far I think I found a winner.

I plan to s follow up post once I really get off and running to the races so stay tuned for updates.

Categories
PowerCLI Virtualization Vmware

PowerCLI – How to backup VCSA 6.5

I have recently been working on an issue with a PowerCLI script that has been working for a few weeks that just stopped working. The script is modified version of the one Kyle Ruddy posted about here:
https://blogs.vmware.com/PowerCLI/2018/07/automate-file-based-backup-of-vcsa.html

The script also uses Credentials store to be able to run the script securely but other than that the script is pretty vanilla.

Now that you are up to speed with how it is supposed to work, my next post will cover the issue, and how to resolve it.

Categories
PowerCLI Virtualization Vmware

PowerCLI – Datastore Report

I recently was working in an environment where they are still running vSphere 6.0. While doing some storage expansions I discovered that the Flash Client and the C# Client were not reporting the same size on the Datastore. This can be very frustrating as you are not sure which one you can trust. So as a tie breaker I decided to turn to my good friend PowerCLI.

It turns out that the PowerCLI and the C# client were reporting the same thing. So I decided to create a PowerCLI Script to assist me in my work. You can find the script there on my Github:

https://github.com/kenbshinn/PowerCLI-Scripts/blob/master/VM_Datastore_Report.ps1

I hope you found this post helpful and will share it with your friends.

Categories
PowerCLI Virtualization Vmware

PowerCLI – Virtual Host Hardware Information

I have recently been working on a asset inventory issue where I was provided a list of serial numbers from our hardware vendor and I was asked to reconcile it with what we had. Well that is easier said than done in most cases.

I know that vCenter collects a bunch of hardware information and I wanted to see if there was a way to pull the Serial number that is on the System board and put that information into a .csv.

In comes the following command:

 Get-VMHost | Get-VMHostHardware -SkipAllSslCertificateChecks | Export-Csv C:tempVMHostHardware.csv

This command will pull all the hardware information that vCenter records and puts it to a .CSV.

I will do my best to update this post with an example of what the results will look like.

I hope you find this post helpful, if so please share with your friends.

Categories
PowerCLI Virtualization Vmware

PowerCLI – vSphere Role Privilege report

So I have been looking for ways to expand my knowledge with PowerCLI. This whole effort came about from going to VMWorld 2019 in San Francisco and seeing presentations by Kyle Ruddy and Luc Denkens. Let me tell you, they did some amazing things in their presentations. 

I had been working on a project where I needed to get list of all of the Non-Standard vCenter Roles along with the privileges assigned to those roles. I am still very new to this whole PowerCLI thing, but my google skills are top notch. I found a blog post on this blog http://kunaludapi.blogspot.com/
I ran the script to see how well it worked and it worked as advertised. I created a copy of the script on my Github which you can find here: https://github.com/kenbshinn/PowerCLI-Scripts/blob/master/vSphere_Role_Report.ps1
I hope you find this post helpful, and if you do please share it with your friends and colleagues.
Categories
PowerCLI Virtualization Vmware

Getting past Certificate issue in Power CLI

So I recently started working more with PowerCLI. After my time at VMWorld 2019 (which I will cover in another post) I realized how powerful that PowerCLI actually is (pun not intended). In starting to work with PowerCLI I came across the following message whil: trying to connect to my vCenter

Connect-vIServer : xx-x-xxxx xx:xx:xx Connect-VIServer Error: Invalid server certificate. Use Set-PowerCLIConfiguration to set the value for the InvalidCertificateAction option to Prompt if you’d like to connect once or to add a permanent exception for this server.

I did some googling and I found this article,so shout out to Ivo Beerens for his article.

https://www.ivobeerens.nl/2018/07/18/quick-tip-powercli-invalid-server-certificate-error/

In his article he goes on to share this command

Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false

After putting that into PowerShell and pressing enter you will no longer get the Invalid Certificate message.

I hope you found this post helpful, I will be posting about some of the scripts that I have been posting on my Github. Please share with your friends if you found this helpful. 
Categories
PowerCLI Virtualization Vmware

Power off entire Virtual Environment using a PowerShell Script and PowerCLI

So I have a lab that I manage where we have had several scheduled power outages in the last few months. So it is my job to make sure that we power off the lab so none of our equipment have issues when we bring it back up.

I would estimate that our lab is comprised of about 90% VMware ESXi Hosts, and after going through the exercise of powering off the whole lab 1 or 2 times, it became it bit of a pain.

So I created a PowerShell Script using PowerCLI to not only power off all the Virtual Machine, but also the Virtual Hosts, and the VCSA appliance itself.

I have posted the script to my Github which you an check out here:

https://github.com/kenbshinn/Poweroff_VirtualEnvironment

Feel free to check it out and let me know what you think.

I hope you found this post helpful, and if so, please share it with your friends.