-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: added vcpu_server module * fix: remove cpu_family option, fix test * fix: VCPU instead of VCPU_INSTANCE * test: running vcpu server test * docs: generate docs * tests: change location for vcpu server * tests: change location for vcpu server * docs: updated examples [skip actions] --------- Co-authored-by: Mihaela Mihalescu <[email protected]>
- Loading branch information
1 parent
2b362f3
commit b293575
Showing
5 changed files
with
1,432 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,273 @@ | ||
# vcpu_server | ||
|
||
Create, update, destroy, update, start, stop, and reboot a Ionos virtual machine. When the virtual machine is created it can optionally wait for it to be 'running' before returning. | ||
|
||
## Example Syntax | ||
|
||
|
||
```yaml | ||
# Provisioning example. This will create three servers and enumerate their names. | ||
- vcpu_server: | ||
datacenter: Tardis One | ||
name: web%02d.stackpointcloud.com | ||
cores: 4 | ||
ram: 2048 | ||
volume_size: 50 | ||
image: ubuntu:latest | ||
location: us/las | ||
count: 3 | ||
assign_public_ip: true | ||
|
||
# Update Virtual machines | ||
- vcpu_server: | ||
datacenter: Tardis One | ||
instance_ids: | ||
- web001.stackpointcloud.com | ||
- web002.stackpointcloud.com | ||
cores: 4 | ||
ram: 4096 | ||
availability_zone: ZONE_1 | ||
state: update | ||
# Rename virtual machine | ||
- vcpu_server: | ||
datacenter: Tardis One | ||
instance_ids: web001.stackpointcloud.com | ||
name: web101.stackpointcloud.com | ||
cores: 4 | ||
ram: 4096 | ||
availability_zone: ZONE_1 | ||
state: update | ||
|
||
# Removing Virtual machines | ||
- vcpu_server: | ||
datacenter: Tardis One | ||
instance_ids: | ||
- 'web001.stackpointcloud.com' | ||
- 'web002.stackpointcloud.com' | ||
- 'web003.stackpointcloud.com' | ||
wait_timeout: 500 | ||
state: absent | ||
|
||
# Starting Virtual Machines. | ||
- vcpu_server: | ||
datacenter: Tardis One | ||
instance_ids: | ||
- 'web001.stackpointcloud.com' | ||
- 'web002.stackpointcloud.com' | ||
- 'web003.stackpointcloud.com' | ||
wait_timeout: 500 | ||
state: running | ||
|
||
# Stopping Virtual Machines | ||
- vcpu_server: | ||
datacenter: Tardis One | ||
instance_ids: | ||
- 'web001.stackpointcloud.com' | ||
- 'web002.stackpointcloud.com' | ||
- 'web003.stackpointcloud.com' | ||
wait_timeout: 500 | ||
state: stopped | ||
|
||
``` | ||
| ||
|
||
| ||
|
||
# state: **running** | ||
```yaml | ||
# Starting Virtual Machines. | ||
- vcpu_server: | ||
datacenter: Tardis One | ||
instance_ids: | ||
- 'web001.stackpointcloud.com' | ||
- 'web002.stackpointcloud.com' | ||
- 'web003.stackpointcloud.com' | ||
wait_timeout: 500 | ||
state: running | ||
|
||
``` | ||
### Available parameters for state **running**: | ||
| ||
|
||
| Name | Required | Type | Default | Description | | ||
| :--- | :---: | :--- | :--- | :--- | | ||
| datacenter | True | str | | The datacenter to provision this virtual machine. | | ||
| instance_ids | False | list | | list of instance ids. Should only contain one ID if renaming in update state | | ||
| api_url | False | str | | The Ionos API base URL. | | ||
| certificate_fingerprint | False | str | | The Ionos API certificate fingerprint. | | ||
| username | False | str | | The Ionos username. Overrides the IONOS_USERNAME environment variable. | | ||
| password | False | str | | The Ionos password. Overrides the IONOS_PASSWORD environment variable. | | ||
| token | False | str | | The Ionos token. Overrides the IONOS_TOKEN environment variable. | | ||
| wait | False | bool | True | Wait for the resource to be created before returning. | | ||
| wait_timeout | False | int | 600 | How long before wait gives up, in seconds. | | ||
| state | False | str | present | Indicate desired state of the resource. | | ||
|
||
| ||
|
||
| ||
# state: **stopped** | ||
```yaml | ||
# Stopping Virtual Machines | ||
- vcpu_server: | ||
datacenter: Tardis One | ||
instance_ids: | ||
- 'web001.stackpointcloud.com' | ||
- 'web002.stackpointcloud.com' | ||
- 'web003.stackpointcloud.com' | ||
wait_timeout: 500 | ||
state: stopped | ||
|
||
``` | ||
### Available parameters for state **stopped**: | ||
| ||
|
||
| Name | Required | Type | Default | Description | | ||
| :--- | :---: | :--- | :--- | :--- | | ||
| datacenter | True | str | | The datacenter to provision this virtual machine. | | ||
| instance_ids | False | list | | list of instance ids. Should only contain one ID if renaming in update state | | ||
| api_url | False | str | | The Ionos API base URL. | | ||
| certificate_fingerprint | False | str | | The Ionos API certificate fingerprint. | | ||
| username | False | str | | The Ionos username. Overrides the IONOS_USERNAME environment variable. | | ||
| password | False | str | | The Ionos password. Overrides the IONOS_PASSWORD environment variable. | | ||
| token | False | str | | The Ionos token. Overrides the IONOS_TOKEN environment variable. | | ||
| wait | False | bool | True | Wait for the resource to be created before returning. | | ||
| wait_timeout | False | int | 600 | How long before wait gives up, in seconds. | | ||
| state | False | str | present | Indicate desired state of the resource. | | ||
|
||
| ||
|
||
| ||
# state: **absent** | ||
```yaml | ||
# Removing Virtual machines | ||
- vcpu_server: | ||
datacenter: Tardis One | ||
instance_ids: | ||
- 'web001.stackpointcloud.com' | ||
- 'web002.stackpointcloud.com' | ||
- 'web003.stackpointcloud.com' | ||
wait_timeout: 500 | ||
state: absent | ||
|
||
``` | ||
### Available parameters for state **absent**: | ||
| ||
|
||
| Name | Required | Type | Default | Description | | ||
| :--- | :---: | :--- | :--- | :--- | | ||
| name | False | str | | The name of the virtual machine. | | ||
| datacenter | True | str | | The datacenter to provision this virtual machine. | | ||
| instance_ids | False | list | | list of instance ids. Should only contain one ID if renaming in update state | | ||
| api_url | False | str | | The Ionos API base URL. | | ||
| certificate_fingerprint | False | str | | The Ionos API certificate fingerprint. | | ||
| username | False | str | | The Ionos username. Overrides the IONOS_USERNAME environment variable. | | ||
| password | False | str | | The Ionos password. Overrides the IONOS_PASSWORD environment variable. | | ||
| token | False | str | | The Ionos token. Overrides the IONOS_TOKEN environment variable. | | ||
| wait | False | bool | True | Wait for the resource to be created before returning. | | ||
| wait_timeout | False | int | 600 | How long before wait gives up, in seconds. | | ||
| state | False | str | present | Indicate desired state of the resource. | | ||
|
||
| ||
|
||
| ||
# state: **present** | ||
```yaml | ||
# Provisioning example. This will create three servers and enumerate their names. | ||
- vcpu_server: | ||
datacenter: Tardis One | ||
name: web%02d.stackpointcloud.com | ||
cores: 4 | ||
ram: 2048 | ||
volume_size: 50 | ||
image: ubuntu:latest | ||
location: us/las | ||
count: 3 | ||
assign_public_ip: true | ||
|
||
``` | ||
### Available parameters for state **present**: | ||
| ||
|
||
| Name | Required | Type | Default | Description | | ||
| :--- | :---: | :--- | :--- | :--- | | ||
| name | True | str | | The name of the virtual machine. | | ||
| assign_public_ip | False | bool | False | This will assign the machine to the public LAN. If no LAN exists with public Internet access it is created. | | ||
| image | True | str | | The image alias or ID for creating the virtual machine. | | ||
| image_password | False | str | | Password set for the administrative user. | | ||
| ssh_keys | False | list | | Public SSH keys allowing access to the virtual machine. | | ||
| user_data | False | str | | The cloud-init configuration for the volume as base64 encoded string. | | ||
| volume_availability_zone | False | str | | The storage availability zone assigned to the volume. | | ||
| datacenter | True | str | | The datacenter to provision this virtual machine. | | ||
| cores | False | int | 2 | The number of CPU cores to allocate to the virtual machine. | | ||
| ram | False | int | 2048 | The amount of memory to allocate to the virtual machine. | | ||
| availability_zone | False | str | AUTO | The availability zone assigned to the server. | | ||
| volume_size | False | int | 10 | The size in GB of the boot volume. | | ||
| bus | False | str | VIRTIO | The bus type for the volume. | | ||
| count | False | int | 1 | The number of virtual machines to create. | | ||
| location | False | str | us/las | The datacenter location. Use only if you want to create the Datacenter or else this value is ignored. | | ||
| lan | False | str | | The ID or name of the LAN you wish to add the servers to (can be a string or a number). | | ||
| nat | False | bool | False | Boolean value indicating if the private IP address has outbound access to the public Internet. | | ||
| remove_boot_volume | False | bool | True | Remove the bootVolume of the virtual machine you're destroying. | | ||
| disk_type | False | str | HDD | The disk type for the volume. | | ||
| nic_ips | False | list | | The list of IPS for the NIC. | | ||
| boot_volume | False | str | | The volume used for boot. | | ||
| boot_cdrom | False | str | | The CDROM used for boot. | | ||
| api_url | False | str | | The Ionos API base URL. | | ||
| certificate_fingerprint | False | str | | The Ionos API certificate fingerprint. | | ||
| username | False | str | | The Ionos username. Overrides the IONOS_USERNAME environment variable. | | ||
| password | False | str | | The Ionos password. Overrides the IONOS_PASSWORD environment variable. | | ||
| token | False | str | | The Ionos token. Overrides the IONOS_TOKEN environment variable. | | ||
| wait | False | bool | True | Wait for the resource to be created before returning. | | ||
| wait_timeout | False | int | 600 | How long before wait gives up, in seconds. | | ||
| state | False | str | present | Indicate desired state of the resource. | | ||
|
||
| ||
|
||
| ||
# state: **update** | ||
```yaml | ||
# Update Virtual machines | ||
- vcpu_server: | ||
datacenter: Tardis One | ||
instance_ids: | ||
- web001.stackpointcloud.com | ||
- web002.stackpointcloud.com | ||
cores: 4 | ||
ram: 4096 | ||
availability_zone: ZONE_1 | ||
state: update | ||
# Rename virtual machine | ||
- vcpu_server: | ||
datacenter: Tardis One | ||
instance_ids: web001.stackpointcloud.com | ||
name: web101.stackpointcloud.com | ||
cores: 4 | ||
ram: 4096 | ||
availability_zone: ZONE_1 | ||
state: update | ||
|
||
``` | ||
### Available parameters for state **update**: | ||
| ||
|
||
| Name | Required | Type | Default | Description | | ||
| :--- | :---: | :--- | :--- | :--- | | ||
| name | False | str | | The name of the virtual machine. | | ||
| datacenter | True | str | | The datacenter to provision this virtual machine. | | ||
| cores | False | int | 2 | The number of CPU cores to allocate to the virtual machine. | | ||
| ram | False | int | 2048 | The amount of memory to allocate to the virtual machine. | | ||
| instance_ids | False | list | | list of instance ids. Should only contain one ID if renaming in update state | | ||
| boot_volume | False | str | | The volume used for boot. | | ||
| boot_cdrom | False | str | | The CDROM used for boot. | | ||
| api_url | False | str | | The Ionos API base URL. | | ||
| certificate_fingerprint | False | str | | The Ionos API certificate fingerprint. | | ||
| username | False | str | | The Ionos username. Overrides the IONOS_USERNAME environment variable. | | ||
| password | False | str | | The Ionos password. Overrides the IONOS_PASSWORD environment variable. | | ||
| token | False | str | | The Ionos token. Overrides the IONOS_TOKEN environment variable. | | ||
| wait | False | bool | True | Wait for the resource to be created before returning. | | ||
| wait_timeout | False | int | 600 | How long before wait gives up, in seconds. | | ||
| state | False | str | present | Indicate desired state of the resource. | | ||
|
||
| ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.