Project

General

Profile

Actions

Feature #2703

closed

Create vmware virtual machines by cloning a template

Added by Ronny M almost 11 years ago. Updated over 8 years ago.

Status:
Duplicate
Priority:
Normal
Assignee:
-
Category:
Compute resources
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

At the moment vmware vm's created by foreman have a very basic virtual machine hardware configuration.
This means that a created vm is not optimized for our environment and is not making use of the best drivers/virtual-hardware that best suits an installed OS.

If we can use templates as a base for a new vm then we can tweak the template as desired and clone it to a vm with all the specs we need.
It would be nice if the cpu, mem, disk configurations in foreman would be applied against the clone of the template upon vm creation.
This way we could create a few needed templates and use them to create different virtual machines based om installed OS and architecture.


Related issues 1 (0 open1 closed)

Is duplicate of Foreman - Feature #2438: Ability to deploy hosts from vmware templatesClosed04/29/2013Actions
Actions #1

Updated by Dominic Cleal almost 11 years ago

  • Category set to Compute resources
Actions #2

Updated by uncle billy over 10 years ago

+1 for this feature!

Actions #3

Updated by Ronny M over 10 years ago

Not sure if needed but below a script that I created (with help of google) that uses fog to clone a vm with almost everything that I need or like to have.

I'm still trying to find a way to change the disk sizes of the newly created vm.

I assume it might be possible to change the "New Host" UI and feed the network, cpu, mem and location choices based on a selected template or vm and use a vm_clone fog command instead of an vm_create command with foreman.

#!/usr/bin/env ruby

require 'fog'
require 'pp'

connection = Fog::Compute[:vsphere]
puts "Connected to #{connection.vsphere_server} as #{connection.vsphere_username} (API version #{connection.vsphere_rev})"

options = {
'datacenter' => 'CJIB',
'template_path' => '/rhel6_clone',
'name' => 'rhel6_vm',
'power_on' => true,
'memoryMB' => '1024',
'network_label' => 'dvportgroup-255',
'network_adapter_device_key' => '4000',
'numCPUs' => 2,
'resource_pool' => ['thuis','resource pool 2'],
'datastore' => 'datastore1',
'dest_folder' => 'RHEL/Servers',
'wait' => true,

}

new_vm=connection.vm_clone(options)
pp new_vm

Actions #4

Updated by Ronny M over 10 years ago

I'm also thinking of trying to do this with foreman hooks but not yet sure if that will produce the desired result.

Actions #5

Updated by Dominic Cleal over 10 years ago

  • Is duplicate of Feature #2438: Ability to deploy hosts from vmware templates added
Actions #6

Updated by Dominic Cleal over 10 years ago

  • Description updated (diff)
  • Status changed from New to Duplicate

Moving to #2438 as it's got more votes.

Actions

Also available in: Atom PDF