cohesity.dataprotect.backup_migrate_vm (1.0.10) — module

Migrate one or more Virtual Machines from Cohesity Protection Jobs

| "added in version" 1.0.10 of cohesity.dataprotect"

Authors: Naveena (@naveena-maplelabs)

Install collection

Install with ansible-galaxy collection install cohesity.dataprotect:==1.0.10


Add to requirements.yml

  collections:
    - name: cohesity.dataprotect
      version: 1.0.10

Description

Ansible Module used to start a Cohesity Migration Job on a Cohesity Cluster.

When executed in a playbook, the Cohesity migration Job will be validated and the appropriate state action

will be applied.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.

# Restore a single Virtual Machine
- name: Restore a Virtual Machine
  cohesity_migrate_vm:
    cluster: cohesity.lab
    username: admin
    password: password
    state: present
    name: "Ansible Test VM Restore"
    endpoint: "myvcenter.cohesity.demo"
    environment: "VMware"
    job_name: "myvcenter.cohesity.demo"
    vm_names:
      - chs-win-01
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Restore multiple Virtual Machines from a specific snapshot with a new prefix and disable the network
- name: Restore a Virtual Machine
  cohesity_migrate_vm:
    cluster: cohesity.lab
    username: admin
    password: password
    state: present
    name: "Ansible Test VM Restore"
    endpoint: "myvcenter.cohesity.demo"
    environment: "VMware"
    job_name: "myvcenter.cohesity.demo"
    backup_id: "48291"
    vm_names:
      - chs-win-01
      - chs-win-02
    prefix: "rst-"
    network_connected: no

Inputs

    
name:
    description:
    - Descriptor to assign to the Recovery Job.  The Recovery Job name will consist of
      the job_name:name format.
    required: true
    type: str

state:
    choices:
    - present
    - absent
    default: present
    description:
    - Determines the state of the Recovery Job.
    - (C)present a recovery job will be created and started.
    - (C)absent is currently not implemented
    type: str

prefix:
    description:
    - Specifies a prefix to prepended to the source object name to derive a new name for
      the recovered or cloned object.
    type: str

suffix:
    description:
    - Specifies a suffix to appended to the original source object name to derive a new
      name for the recovered or cloned object
    type: str

cluster:
    aliases:
    - cohesity_server
    description:
    - IP or FQDN for the Cohesity Cluster
    type: str

endpoint:
    description:
    - Specifies the network endpoint of the Protection Source where it is reachable. It
      could
    - be an URL or hostname or an IP address of the Protection Source or a NAS Share/Export
      Path.
    required: true
    type: str

job_name:
    description:
    - Name of the Protection Job
    required: false
    type: str

vm_names:
    description:
    - Array of Virtual Machines to restore
    elements: str
    required: false
    type: list

backup_id:
    description:
    - Optional Cohesity ID to use as source for the Restore operation.  If not selected,
      the most recent RunId will be used
    type: int

environment:
    choices:
    - VMware
    default: VMware
    description:
    - Specifies the environment type (such as VMware) of the Protection Source this Job
    - is protecting. Supported environment types include 'VMware'
    required: false
    type: str

power_state:
    default: true
    description:
    - Specifies the power state of the cloned or recovered objects. By default, the cloned
      or recovered objects are powered off.
    type: bool

network_name:
    description:
    - Specifies a network name to be attached to the cloned or recovered object.
    type: str

wait_for_job:
    default: true
    description:
    - Should wait until the Restore Job completes
    type: bool

wait_minutes:
    default: 20
    description:
    - Number of minutes to wait until the job completes.
    type: int

cohesity_admin:
    aliases:
    - admin_name
    - cohesity_user
    - username
    description:
    - Username with which Ansible will connect to the Cohesity Cluster. Domain Specific
      credentails can be configured in following formats
    - AD.domain.com/username
    - AD.domain.com/username@tenant
    - LOCAL/username@tenant
    type: str

datastore_name:
    description:
    - Specifies the datastore where the files should be recovered to. This field is required
      to recover objects to
    - a different resource pool or to a different parent source. If not specified, objects
      are recovered to their original
    - datastore locations in the parent source.
    type: str

validate_certs:
    aliases:
    - cohesity_validate_certs
    default: true
    description:
    - Switch determines if SSL Validation should be enabled.
    type: bool

vm_folder_name:
    description:
    - Specifies a folder name where the VMs should be restored.
    type: str

backup_timestamp:
    description:
    - Future option to identify backups based on a timestamp
    - Currently not implemented.
    type: str

cohesity_password:
    aliases:
    - password
    - admin_pass
    description:
    - Password belonging to the selected Username.  This parameter will not be logged.
    type: str

network_connected:
    default: true
    description:
    - Specifies whether the network should be left in disabled state. Attached network
      is enabled by default. Set this flag to true to disable it.
    type: bool

resource_pool_name:
    description:
    - Specifies the resource pool name where the cloned or recovered objects are attached.
    type: str

interface_group_name:
    description:
    - Specifies the interface name to connect after restoring the VM.
    type: str

recovery_process_type:
    default: InstantRecovery
    description:
    - Specifies the recovery type.
    type: str