Create VMs based on a FortiFlex configuration
Use the fortiflexvm_vms_create
module to create one or more VMs based on a FortiFlex configuration. To modify a VM, see Update an existing VM.
Parameters
The following parameters are included:
Parameter |
Type |
Description |
---|---|---|
|
String (Optional) |
The username to authenticate. If not declared, the code will read the environment variable |
password
|
String (Optional) |
The password to authenticate. If not declared, the code will read the environment variable |
|
Integer |
The ID of the FortiFlex configuration. |
|
Integer (Optional) |
The number of VMs to be created. The default value is 1. |
|
String (Optional) |
The decription of the VMs. |
|
String (Optional) |
The VM end date. It cannot be before today's date or after the program's end date. Any format that satisfies ISO 8601 is accepted but the recommended format is |
|
String (Optional) |
The folder path of the VMs. |
Example
The following is an example use of this module:
- name: Create VMs hosts: localhost collections: - fortinet.fortiflexvm vars: username: "<your_own_value>" password: "<your_own_value>" tasks: - name: Create Virtual Machines fortinet.fortiflexvm.fortiflexvm_vms_create: username: "{{ username }}" password: "{{ password }}" configId: 42 count: 1 description: "Create through Ansible" endDate: "2023-11-11T00:00:00" folderPath: "My Assets" register: result - name: Display response debug: var: result.vms
Return values
The following parameters are returned:
Parameter |
Type Returned |
Description |
---|---|---|
|
List |
The list of virtual machines and their details. |
The vms
list includes:
Parameter |
Type Returned |
Description |
---|---|---|
|
Integer |
The configuration ID of the VM. |
|
String |
The description of the VM. |
|
String |
The end date of the VM's validity. |
|
String |
The serial number of the VM. |
|
String |
The start date of the VM's validity. |
|
String |
The status of the VM. |
|
String |
The token assigned to the VM. |
|
String |
The status of the token assigned to the VM. |