3

We are trying to provide our Linux engineers with a CLI to deploy VMWare vSphere VMs using templates.

The vSphere CLI looks promising but the documentation doesn't mention templates.

Does anyone have any suggestions on how to go about this?

Belmin Fernandez
  • 10,799
  • 27
  • 84
  • 148
  • Check out [ezmomi](https://github.com/snobear/ezmomi) which lets you clone templates to VMs. – Banjer Dec 26 '15 at 00:24

3 Answers3

4

The only option I've found would be using the PySphere SDK

I've used it to do snapshot consolidation and cleanup, but it can certainly do VM creation from a template.

colealtdelete
  • 6,017
  • 2
  • 30
  • 34
2

A couple of thoughts on this...

  • It's almost easier to install Linux operating systems anew if you have a deployment solution and configuration management in place (e.g. Cobbler and Puppet/Chef). I tend not to use vSphere templates for anything other than canned Windows server installations.

  • If that's not possible, and the template deployment process is infrequent, the standard vSphere Web Client and thick client are adequate.

The fact that you've phrased this as "[providing] our Linux engineers with a CLI", makes me wonder if there's been some pushback, or reluctance to use the standard VMware tools.

Is there more context here?

ewwhite
  • 197,159
  • 92
  • 443
  • 809
  • Lack of VMWare Mac client seems to be the primary reason for the request. As is usually the case with Linux folks (myself included), there's a strong preference for CLI processes. – Belmin Fernandez Aug 06 '14 at 19:03
  • 1
    So this has changed over time. The last two releases of vSphere (5.1 and 5.5) have good Mac browser support. As someone who does this professionally, but is technically a Linux engineer by trade, I gravitate towards the right/appropriate tools for the job. For a *loooong* time, that meant keeping a Windows VM or RDP session around in order to use the vSphere client. – ewwhite Aug 06 '14 at 19:20
2

There's a fling, Ruby vSphere Console, that you can make use of.

If your Linux admins prefer Python they could use pyVmomi, but it's more of a library (although you can start Python, import pyVmomi and then use it as a "shell").

There's also virsh but it looks like you can't deploy templates with it. However, googleing for virsh + deploy + template I found vm-easy-deploy that might help you.

Mario Lenz
  • 1,612
  • 9
  • 13