cohesity.dataprotect.cohesity_migrate_vm (1.1.9) — module

Migrate one or more Virtual Machines from Cohesity Migrate Jobs

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

Authors: Naveena (@naveena-maplelabs)

Install collection

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


Add to requirements.yml

  collections:
    - name: cohesity.dataprotect
      version: 1.1.9

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.

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

Inputs

    
name:
    description:
    - Descriptor to assign to the Recovery Job.  The Recovery Job name will consist of
      the name_date_time format.
    required: false
    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 object.
    type: str

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

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

end_time:
    description:
    - Restore tasks will be filtered by a start time specified. If not provided the end
      time is the current time.
    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

datacenter:
    description:
    - If multiple datastore exists, datacenter and cluster resource details are used to
      uniquely identify the resourcepool.
    type: str

start_time:
    description:
    - Restore tasks will be filtered by a start time specified. If not provided the start
      time is set to the last week.
    type: str

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

job_vm_pair:
    description:
    - Key value pair with job names as key and list of Virtual Machines to migrate
    required: true
    type: dict

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

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

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.
    required: true
    type: str

detach_network:
    default: false
    description:
    - If this is set to true, then the network will be detached from the recovered VMs.
      All the other networking parameters set will be ignored if set to true
    type: bool

enable_network:
    default: true
    description:
    - Specifies whether the attached network should be left in enabled state
    type: bool

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

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

resource_pool_name:
    description:
    - Specifies the resource pool name where the migrated objects are attached.
    required: true
    type: str

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

preserve_mac_address:
    default: false
    description:
    - Specifies whether to preserve the MAC address of the migrated VM.
    type: bool

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

cluster_compute_resource:
    description:
    - If the cluster compute resource is specified, VM will be recovered to resource pool
      under the specified compute resource.
    type: str