Customizing Win 10 desktop for vSphere and Terraform

In a previous blog we talked about installing Terraform on Windows 10. In this blog we are going to dive a little deeper and get a vSphere provider configured and ready to use from our Windows 10 desktop. To get started we need a way to get into our vSphere server. The easiest way is to log into the web console and get the information from there.

The more difficult way but allows for better automation is to do everything from the command line. Unfortunately, for Windows the default PowerShell version is not supported by the Command Line Module from VMWare and to run PowerCLI we need to upgrade to PowerShell 6 or higher. At the time of this writing PowerShell 7.0.3 was the latest version available. This binary can be downloaded and installed by following the documentation on the Microsoft website and pulling the binary from the official Microsoft github.com location.

The install is relatively simple and takes a minute or two

Once PowerShell 7 is installed we need to install PowerCLI by using an Install-Module command. The format of the command is

Install-Module -Name VMware.PowerCLI

The installation is relatively simple and takes a minute or two to download the code and extract. Once extracted we can connect to the vSphere server.

When it comes to connecting to the server we can have it ask us for the username and password or set these variables as environment variables. In the following video we set the variables $user and $server as well as the $pwd (not shown) then connect to the server using environment variables. When we first connect the connection fails because the SSL certificate on our server is self-signed and not trusted. To avlid this set need to execute the two commands to get a valid connection

Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false

Connect-VIServer -Server $server -User $user -Password $pwd

From here we can get the DataCenter, Folder structure of the VMs and Templates, as well as the Datastores for this installation.

Getting the parameters that we will need to populate a parameters.tfvars file can be done with the following PowerCLI commands

var.datacenter Get-DataCenter

var.datastore Get-Datastore -Name <name>

var.template_folder Get-Folder -Name “Templates and vCenter”

var.terraform_folder Get-Folder -Name “Terraform”

var.templates Get-Template -Location $var.template_folder

var.terraform_vms Get-VM -Location $var.terraform_folder

From here we have the base level data that we need to populate a parameters.tfvar file and define our datacenter, host, folder structure, datastores, and templates. These are typically relatively static values that don’t change much. At some point we might want to pull in a list of our ISO files to use for initializing raw operating systems. Most companies don’t start with an ISO file but rather a partially configured server that has connections into an LDAP or Active Directory structure as well as the normal applications and security/firewall configurations needed for most applications.

To summarize what we have done is to configure our Windows 10 default terraform desktop so that we can use a browser to pull parameters from a vSphere server as well as script and automate pulling this data from a vSphere server using the PowerCLI Module that runs under PowerShell 6 or 7. We should have access to all of our key data from our vSphere and ESXi server and can populate and create a set of terraform files using variables, data declarations, and resources that we want to create and manage. With this blog we have built the foundation to manage a vSphere or ESXi instance from an HTML browser, a PowerShell command line, or from terraform. The eventual goal is to have terraform do all of the heavy lifting and not enter data like username and password into configuration files so that we can use github for version control of our configuration and management files.

359 thoughts on “Customizing Win 10 desktop for vSphere and Terraform”

  1. Thank you so much for providing individuals with remarkably memorable possiblity to read from this website. It really is very fantastic and as well , full of a lot of fun for me and my office co-workers to search your web site really thrice in 7 days to find out the new secrets you have. Of course, I am also certainly happy with the gorgeous tactics you serve. Certain two facts on this page are absolutely the most effective we have all ever had.

  2. I must voice my respect for your generosity giving support to individuals that must have help on in this field. Your real dedication to getting the solution all through has been astonishingly powerful and have in every case allowed individuals just like me to realize their desired goals. Your amazing insightful tips and hints can mean a great deal a person like me and far more to my fellow workers. Best wishes; from all of us.

  3. I happen to be commenting to let you be aware of what a fine discovery my princess found browsing your site. She realized several things, not to mention what it is like to possess a great helping mindset to get many others just fully understand a variety of tricky subject matter. You truly surpassed readers’ expectations. Thank you for giving those productive, healthy, educational and also unique guidance on the topic to Emily.

  4. I needed to put you one bit of observation just to thank you very much again on the exceptional pointers you have discussed at this time. It’s quite strangely open-handed of you to supply unhampered what a lot of people would’ve made available for an e-book in order to make some profit for themselves, specifically given that you could have tried it in the event you wanted. Those advice in addition acted as a good way to realize that other individuals have a similar dreams much like mine to know the truth great deal more in regard to this condition. I believe there are several more pleasurable periods ahead for people who looked over your site.

  5. I not to mention my buddies happened to be viewing the excellent pointers found on your website while at once got a terrible suspicion I had not thanked the site owner for them. Those guys were definitely thrilled to read all of them and have in effect unquestionably been loving those things. Thank you for being so accommodating and for finding varieties of marvelous guides most people are really wanting to be aware of. Our own honest regret for not saying thanks to sooner.

  6. I want to point out my gratitude for your kind-heartedness supporting individuals that should have help on in this concern. Your personal commitment to passing the message along has been extraordinarily significant and have constantly allowed women like me to realize their ambitions. Your own insightful advice can mean a great deal to me and even more to my office workers. Many thanks; from everyone of us.

  7. I would like to show my love for your kindness giving support to persons that need help with the concept. Your special dedication to getting the message across ended up being exceptionally invaluable and have all the time made individuals just like me to reach their desired goals. Your own valuable suggestions can mean this much to me and especially to my office workers. Thanks a lot; from everyone of us.

  8. I would like to express my appreciation to this writer just for bailing me out of such a matter. Right after looking out through the the web and coming across principles which were not productive, I thought my life was well over. Being alive devoid of the strategies to the issues you have solved through this post is a serious case, and the ones that might have negatively damaged my entire career if I had not come across your website. Your main mastery and kindness in handling all the pieces was valuable. I am not sure what I would’ve done if I had not discovered such a point like this. I’m able to now look ahead to my future. Thank you very much for your impressive and sensible guide. I won’t be reluctant to refer the sites to any person who needs and wants assistance on this issue.

  9. My spouse and i ended up being fortunate that Jordan could complete his basic research while using the precious recommendations he made while using the web pages. It’s not at all simplistic just to happen to be giving freely techniques that other people have been trying to sell. We acknowledge we’ve got the blog owner to give thanks to because of that. The illustrations you have made, the simple web site menu, the friendships you will assist to instill – it’s got most wonderful, and it’s really facilitating our son and our family consider that the issue is entertaining, which is certainly wonderfully mandatory. Many thanks for the whole lot!

  10. I simply wanted to write down a quick note to say thanks to you for these pleasant items you are writing here. My particularly long internet investigation has finally been rewarded with sensible facts to talk about with my family and friends. I would assert that we visitors actually are definitely blessed to exist in a great community with very many awesome people with good advice. I feel quite blessed to have come across your entire webpage and look forward to some more cool minutes reading here. Thanks a lot once again for everything.

  11. I wanted to post you a very little remark in order to give thanks yet again for all the unique opinions you’ve documented on this site. This is so particularly open-handed of people like you to allow unhampered all a number of us might have distributed for an electronic book to earn some cash for themselves, principally considering the fact that you could possibly have done it in the event you wanted. Those tips in addition worked as the good way to understand that other people online have the same desire similar to my own to learn a little more in terms of this matter. I am sure there are thousands of more fun situations up front for individuals who look over your blog.

  12. I truly wanted to jot down a simple comment to express gratitude to you for all the pleasant guides you are placing at this site. My extended internet lookup has at the end been compensated with reputable points to exchange with my good friends. I ‘d believe that most of us site visitors actually are really endowed to dwell in a good place with many special individuals with great principles. I feel somewhat privileged to have encountered the web pages and look forward to plenty of more brilliant moments reading here. Thank you again for everything.

  13. My husband and i got thankful Raymond could finish off his preliminary research out of the precious recommendations he discovered from your very own web pages. It is now and again perplexing to simply choose to be giving out secrets and techniques that the rest could have been making money from. And now we see we have got the website owner to appreciate because of that. The illustrations you have made, the easy website navigation, the relationships you will make it easier to create – it’s got most amazing, and it’s really leading our son in addition to our family reckon that this content is exciting, which is wonderfully vital. Many thanks for all the pieces!

  14. I simply wanted to write a message to express gratitude to you for all of the fantastic guidelines you are showing on this website. My time intensive internet research has finally been honored with reputable content to write about with my contacts. I ‘d believe that most of us readers are rather lucky to live in a magnificent website with so many lovely people with helpful secrets. I feel quite lucky to have used the web pages and look forward to some more entertaining minutes reading here. Thank you once again for all the details.

  15. Thank you a lot for providing individuals with remarkably pleasant possiblity to read from this web site. It is always so good and also packed with a lot of fun for me and my office co-workers to visit your website particularly three times in 7 days to see the latest things you have. And indeed, I’m also at all times impressed concerning the unbelievable tactics you serve. Some 2 ideas in this post are surely the most efficient we’ve had.

  16. Pingback: 2specious
  17. I wish to point out my admiration for your kind-heartedness supporting visitors who need help with this subject. Your special dedication to passing the message all-around had been incredibly beneficial and have surely permitted most people just like me to achieve their objectives. Your warm and helpful suggestions denotes this much a person like me and even further to my fellow workers. With thanks; from everyone of us.

  18. I’m just writing to let you know what a awesome encounter my friend’s girl found using your webblog. She figured out many issues, which include how it is like to have an awesome coaching spirit to have others just learn about selected problematic things. You truly exceeded people’s desires. Thanks for imparting the interesting, trustworthy, edifying and as well as easy guidance on your topic to Julie.

  19. I intended to write you one little word so as to say thanks a lot over again with your amazing solutions you have featured in this case. It was so surprisingly open-handed with people like you to give unhampered what exactly a lot of folks would’ve advertised as an e book to generate some cash on their own, mostly considering that you could possibly have tried it in the event you decided. Those techniques also acted to be a easy way to be certain that someone else have similar eagerness much like my own to know the truth somewhat more pertaining to this problem. I am sure there are millions of more pleasurable situations ahead for folks who go through your blog.

  20. I must show my appreciation for your generosity for people that really need assistance with this important study. Your personal commitment to passing the solution all through turned out to be astonishingly advantageous and has truly allowed many people just like me to achieve their ambitions. Your personal helpful information signifies much to me and especially to my fellow workers. Regards; from everyone of us.

  21. I and my buddies came digesting the best ideas from your web page while then came up with a horrible suspicion I had not thanked the web blog owner for those techniques. The guys were as a result very interested to read through all of them and have now unquestionably been having fun with these things. Appreciation for really being simply helpful as well as for using certain beneficial resources most people are really wanting to be informed on. My honest apologies for not expressing appreciation to earlier.

  22. A lot of thanks for your own hard work on this website. My mum take interest in doing internet research and it is obvious why. I learn all relating to the compelling tactic you convey useful tips via the web site and even increase participation from some other people on this idea so our simple princess is without question understanding a great deal. Have fun with the rest of the year. You are performing a pretty cool job.

  23. I and also my guys were analyzing the great information found on the blog and so suddenly came up with a horrible feeling I never thanked the web site owner for those tips. All of the boys were consequently glad to read through them and have in effect sincerely been having fun with those things. Thank you for being very accommodating and also for obtaining this kind of impressive ideas millions of individuals are really desirous to be aware of. My very own honest regret for not expressing gratitude to you sooner.

  24. I definitely wanted to compose a message to say thanks to you for all the great tactics you are placing at this site. My considerable internet research has finally been rewarded with pleasant strategies to write about with my best friends. I ‘d suppose that many of us website visitors actually are very lucky to exist in a fine community with very many brilliant professionals with good opinions. I feel very grateful to have encountered your site and look forward to many more excellent moments reading here. Thank you once more for a lot of things.

  25. My spouse and i felt very more than happy that Michael managed to finish off his studies while using the precious recommendations he was given out of the web pages. It is now and again perplexing to simply happen to be giving for free tips and hints which often people today might have been trying to sell. And we also see we have the website owner to give thanks to for this. Those explanations you’ve made, the simple site menu, the relationships you can assist to engender – it’s got many incredible, and it is helping our son and our family recognize that this issue is exciting, and that’s highly essential. Many thanks for the whole lot!

  26. I and also my pals happened to be reading the excellent ideas located on your web site while all of a sudden developed an awful feeling I never expressed respect to the blog owner for them. All the young boys ended up consequently stimulated to read through them and have in effect actually been taking advantage of those things. Appreciate your truly being well kind and for using such outstanding subject areas millions of individuals are really wanting to know about. Our honest apologies for not expressing gratitude to earlier.

  27. Opportunities don’t happen.
    Washington also said, It is better to offer no excuse than a bad one.
    Yup, he was reminding Philadelphians that preventing fires is better than fighting them.
    The original saying was, Eat an apple on going to bed, and you’ll keep the doctor from earning his bread.
    Then use it as a guideline to stay focused on your general theme.
    Curiosity killed the cat.
    It’s a great saying, but it’s not something you’d necessarily repeat over the dinner table.
    This famous motto highlights the truism that life is full of ups and downs.
    Luke’s having a tough time, and he’s discouraged.
    Sandys said, Honestie the best policie, which in modern English is…
    Yup, he was reminding Philadelphians that preventing fires is better than fighting them.
    (I say these words to make me glad),
    From there, you can build your story around it.
    Aphorisms are so common that we hardly think twice about them.
    Repeat after me.
    This famous motto highlights the truism that life is full of ups and downs.

  28. What am I referring to.
    Washington’s message was that it’s wiser to be upfront and deal with the consequences.
    Sometimes, though.
    Skilled writers use aphorisms to evoke big ideas in a relatable way.
    But there’s no certain magic to sprinkling aphorisms into your writing.
    Now here’s the big question.
    Proverbs, on the other hand, can be much longer than aphorisms and adages.
    So what do you do.
    It’s one of my favorite aphorisms because it’s simple but yet powerful.
    Napoleon Bonaparte could relate.
    The complete quote was, A Jack of all trades and master of none, but oftentimes better than a master of one.
    Now you might be asking.
    Aphorisms can act as a guideline to help narrow the focus of your work.
    An aphorism is a literary device that uses a short, clever saying to express a general truth.
    Do you believe that a penny saved is a penny earned.
    Another success aphorism comes from Chris Grosser.

Leave a Reply

Your email address will not be published. Required fields are marked *