ScaleComputing / HyperCoreAnsibleCollection

Official Ansible collection for Scale Computing SC//HyperCore (HC3) v1 API
GNU General Public License v3.0
12 stars 8 forks source link

:rocket: Feature request: vm_info should provide data to identify replication target VMs #162

Closed ddemlow closed 1 year ago

ddemlow commented 1 year ago

Is your feature request related to a problem? Please describe.

I would like to be able to identify which VM's are replication targets in order to provide automation like cloning / starting for disaster recovery testing and declaration.

also replication target VM's can't be powered on without first cloning them to another name/UUID

(in virdomain api - these can be identified with presence of sourceVirDomainUUID - which is the UUID of the VM on the replication source cluster - it's name would be the same as vm name on the target cluster)

Describe the solution you'd like

exposing sourceVirDomainUUID itself could be one option or perhaps just expose as a bool - replication_target: true - or both.

Describe alternatives you've considered

current workaround would be to use api module and look for sourceVirDomainUUID

Additional context

Add any other context or screenshots about the feature request here.

example of replication target VMs in UI

image
justinc1 commented 1 year ago

I was looking at data in HyperCore API, on source and destination side. On source side, VM/VirDomain also has replicationUUIDs, and this one can be used to get UUID of replicated VM on destination side.

https://10.5.11.50/rest/v1/VirDomain/5bea9af0-8f1c-461f-8e1a-9da9fb5fe309
        "name": "ci-vm-replicated",
        "replicationUUIDs": [
            "58b74186-76e4-49df-b962-0e2c89c03ea2"
        ],
        "sourceVirDomainUUID": "",

https://10.5.11.50/rest/v1/VirDomainReplication/58b74186-76e4-49df-b962-0e2c89c03ea2
        "connectionUUID": "fbf2f5b1-3817-4a42-b600-aa360f7da3ec",
        "sourceDomainUUID": "5bea9af0-8f1c-461f-8e1a-9da9fb5fe309",
        "targetDomainUUID": "efc9a3cf-501c-4969-834b-bd2dbb760897",
        "uuid": "58b74186-76e4-49df-b962-0e2c89c03ea2"

This info could be useful, but during disaster recovery we should not assume source cluster is accessible at all. So we are lest only with destination VM sourceVirDomainUUID value.

Modules vm, vm_info will return this as replication_source_vm_uuid, it will be UUID or empty string.