PowerCLI in the PowerShell Gallery – how to and why?

PowerCLI is the best managing and automation tool for vSphere environments. I cannot imagine my work without this fantastic thing. The only one inconvenience I see in the PowerCLI is an installation procedure. In every single Windows I have to download and install .msi package. But now it has changed! We can find PowerCLI in the PowerShell Gallery – now there are two versions, 6.5.1.5377412 and 6.5.1.5273662. How to install PowerCLI from the PowerShell Gallery? Installation process is very simple. You just need to type the following command in your PowerShell (don’t forget to run as Administrator):

If you cannot install because of “The Continue reading

Alias for Connect-VIServer arguments – PowerShell functions

I think most of you agree with me when I say that typing “Connect-VIServer -Server name-of-server” is very annoying. Especially when you have many vCenter Servers to manage. First thing that comes to everybody’s mind is “hey, we can use PowerShell aliases”! And yes, but only for shorten cmdlet. You can have some problems with passing parameters into the alias. But don’t worry, there is another – better in my opinion – way to do that. Functions. It’s a simple way for creating aliases for Connect-VIServer arguments. Without further ado, there you are a template of the mentioned functions: View the code Continue reading

Ansible MySQL role – creating databases and users

When you have only one local database server dedicated to your application, there are no problems with creating a database and a user. But the problem appears when we want to create many databases and users manually. Of course we can create a bash script and run it everytime we want to create a new database and user, but there is another and easier way. This way is called Ansible. Ansible is a really helpful and excellent tool for automation. I have tried to use Ansible anytime since I have heard about it the first time. Some time ago I Continue reading

Check your domain expiration with Icinga2

It’s good to know what is going on inside your infrastructure. Monitoring is one of the most important systems (including backup – verified backup of course!) used by all companies. There are tons of tools which help sysadmins with monitoring their infrastructure. I have started my monitoring adventure with Icinga2, and for now, I don’t plan to change it. 🙂 Icinga2 has not only great community, but also distributed monitoring possibility and such obvious thing like High Availability. Icinga2 has also many plugins and everyone can do one by their own. I have taken this opportunity and I have created simple Continue reading

Terraform 0.9.0 was released

It has been two weeks since Terraform 0.9.0-beta2 was released, and now we can enjoy a new stable version! It’s a pleasure to say that 3 hours ago Hashicorp has released Terraform 0.9.0. In the current version you can find changes I mentioned in the previous post and of course much more! I think that the most important things in the newest release are Remote Backends and State Locking. Remote Backend replaces remote state and it changes architecture of tracking the state of your infrastructure. You can find more information in the #11286 Pull Request and in official Terraform documentation. There is a Continue reading

Fun with PowerCLI – how to get Windows VMs in vCloud Director

Honestly speaking, I’m in love with PowerCLI. I know that VMware admin cannot optimize his job without PowerCLI, but in my case it’s a higher level of scripting love. At first, I want to stress that my scripting experience started with Linux systems and its scripting languages. I have been in awe of how excellent PowerShell can be since I decided to simplify my work with Windows Servers. Of course VMware administration has enforced me to become friends with PowerShell. New cmdlets, new possibilities, and – last but not least – the best way for managing and configuring VMware vSphere Continue reading

Terraform 0.9.0-beta2 was released

Terraform 0.9.0-beta2 was released on 2nd March 2017. It contains some bug fixes (including 0.9.0-beta1 fixes), two features and six improvements. At the same time Hashicorp has released version 0.8.8, which contains, among other, a new provider – Spotinst. Also 0.8.8 version of Terraform introduces a new interpolation – slice. Slice allows you to get “the portion of list between from (inclusive) and to (exclusive)”. Syntax of this interpolation is simple – slice(list, from, to). Moreover there are some new Resources and Data Users and lot of bug fixes. Below you can see the full Release Notes for both versions. If you need more information Continue reading

Deploying vSphere VM with Terraform

Do you know when infrastructure deploying was revolutionized? It was the day when the world saw the Terraform for the first time. Yes, Infrastructure as a Code is a great idea which can simplify our infrastructure provisioning. We can see the full power of the Terraform just with an AWS, but it can be also used with another Cloud Providers. In the Terraform documentation you can find Google Cloud, Digital Ocean, Microsoft Azure, but also private and on-premise providers like Openstack or VMware vSphere. I work with VMware vSphere and VMware vCloud Director, so Terraform is designed for me too! Continue reading

Terraform spec.identity.hostName error with vSphere provider

Today I’ve got a short post. It is especially dedicated to the new Terraform users, who use this tool for automation vSphere virtual machines. It is simply a matter of time till you face this problem. I mean, Terraform spec.identity.hostName error when you try to deploy your vSphere infrastructure. Why? Let me explain. What is the problem? At first I’ll show you the problem. After applying Terraform build, virtual machine is cloning and when a customization operation should start, you see something like this: When does Terraform spec.identity.hostName error appear? I met this problem once and it was caused by my habit and Continue reading

Ansible template Role – easy way of creating projects

Working with Ansible is a real pleasure. You can build your own roles and big projects with many combinations and configurations. But sometimes you only want to quickly deploy a whole project with specified roles. When your automation needs to run many roles in different configurations, you face the problem of flexibility and fast deployment. Admittedly, Ansible community created tons of solutions, but maybe this one would be helpful for some of you. Especially with fast or temporary provisioning projects on the nodes without fully configured Ansible environment. Ansible template Role is my fork of the Mohamed Boufnichel’s ansible_project_template Role. I Continue reading