Use VMware Perl SDK to manage a vSphere infrastructure

Hello,

Here is my first API post on this blog. I used to post some API scripts on OVH forums and I want to use this media to share more of them and show you how easy it is to run scripts on top on VMware infrastructure. I had a chance to present VMware Perl SDK and how it helps sysadmin on VMworld a couple of years ago.

First of all, I’m going to show you how to connect to a vSphere infrastructure and then how to list all your virtual machines. This is a quick introduction but I think it is required to understand how it works.

Thanks for reading and I hope it will be useful for your internal needs.

Overview

I run my scripts on top on a OVH Dedicated Cloud, which is basically a vSphere infrastructure. If you need anything about VMware APIs and SDKs, you can find everything here. One of the best argument on this Perl SDK is that it can run on Linux box. You can also find a python SDK, but it is less powerful than the perl one, there are a lot of call missing.

All my scripts will require one connection to a vCenter, so you need to have a login and a password with the rights you need to perform all the operations you want. For this particular use case, “read only” rights are sufficient.

Continue reading “Use VMware Perl SDK to manage a vSphere infrastructure”

Import virtual machines to vSphere environment using Veeam

There is a lot of answers to “how to move virtual machines between vSphere infrastructures?”. Indeed, we can move vms files or use ovfTools, but there are some solutions that allow you to do it easily with less downtime. Here I will explain how to use Veeam Backup & Replication to do it.

veeam_2014_logo_color_tag

Overview

I have two vSphere infrastructures and I want to migrate my virtual machines from the old to the new one. In my lab, I will work on two dedicatedCloud provided by OVH. My old infrastructure is located at Roubaix and I want to migrate all my virtual machines to Strasbourg. This solution also works if I want to migrate virtual machines from my own datacenter to any other vSphere infrastructure.

As I placed my two dedicatedCloud in the same vRack, I can use a private network to transfert my virtual machines between the two infrastructure. We can also do it through a public network. Continue reading “Import virtual machines to vSphere environment using Veeam”