scale_computing.hypercore.template2vm role – Clone a template VM to a regular VM

Note

This role is part of the scale_computing.hypercore collection (version 1.6.0).

It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it use: ansible-galaxy collection install scale_computing.hypercore.

To use it in a playbook, specify: scale_computing.hypercore.template2vm.

Entry point main – Clone a template VM to a regular VM

Synopsis

  • Role url2template is used to clone a template VM to a regular VM.

  • Most parameters have 1-to-1 mapping to scale_computing.hypercore.vm parameters.

Parameters

Parameter

Comments

template2vm_description

string / required

Description for new VM.

template2vm_disk_size

integer / required

Disk size for VM OS disk, in bytes unit.

Needs to be bigger or equal to source template VM OS disk.

template2vm_memory

integer / required

Memory for new VM.

template2vm_meta_data

string

Cloud-init meta-data.

Default: ""

template2vm_nics

list / elements=dictionary

List of network interfaces.

See also scale_computing.hypercore.vm_nic parameter items.

Default: [{"type": "virtio", "vlan": 0}]

connected

boolean

Is network interface connected or not.

Choices:

  • false

  • true ← (default)

mac

string

NIC MAC address.

Default: ""

type

string

Defines type of the network interface.

Choices:

  • "virtio" ← (default)

  • "RTL8139"

  • "INTEL_E1000"

vlan

integer

NIC VLAN.

Default: 0

template2vm_power_state

string / required

Power state for new VM.

template2vm_source_vm_name

string / required

The source template VM used to create a new VM.

template2vm_user_data

string

Cloud-init user-data.

Default: ""

template2vm_vcpu

integer / required

vCPU count for new VM.

template2vm_vm_name

string / required

The VM to be created.

template2vm_vm_tags

list / elements=string / required

VM tags for new VM.

Entry point wait_vm_boot_tasks – Wait until VM is booted

Synopsis

  • Wait until VM is booted - e.g. ssh connection can be made.

  • As new VM(s) were just created on HyperCore, an inventory refresh is made before check if VMs are reachable via ssh.

  • Inventory refresh is needed before each check, to ensure we get DHCP assigned VM IP address.

Parameters

Parameter

Comments

template2vm_wait_vm_boot_tasks_dummy_param

string

Ignore this. ansible-lint does not like role with empty options; so we have a dummy param.

Default: ""