VMware Cloud Community
hornseym
Contributor
Contributor

vShpere Replication: Shutting down programatically (e.g. via Python)

Hi,

Is there a way to shutdown a vSphere Replication server through software (e.g. from a Python application)?

I need to write a program to shutdown various vSphere components including a vSphere Replication Server (followed by the hardware it is running on). This is running in a VM.

Shutting it down badly could corrupt the backups the vSphere Replication is doing. I have been told this is what will happen if I shut it down via the vSphere API for shutting down VMs.

I can't leave it on as it will get shutdown badly when the rest of the system is shutdown (e.g. the ESXi Host it is running on).

Does anyone know if there is a set of APIs (e.g. Python, REST, etc.) that I could use for shutting down the vSphere Replication cleanly? Or is there another route to shut it down cleanly?

Any help or suggests would be appreciated; any questions, I'll answer them as quickly as I can.

Many thanks,

Reply
0 Kudos
7 Replies
ashilkrishnan
VMware Employee
VMware Employee

Hi hornseym​,

vSphere replication VM can be shutdown like any other VM. For rest API, you can refer --> REST API - shutdown

For PowerCLI reference --> Shutdown-VMGuest - vSphere PowerCLI Cmdlets Reference

Hope that helps

Reply
0 Kudos
hornseym
Contributor
Contributor

Hi ashilkrishnan​,

Thank you for your quick response 🙂

I've been told I cannot shut the vSphere Replication VM down like a normal VM (e.g. through vSphere and the API); I have been told this is likely to corrupt the backup.

I've been told the current safe we know of to shut it down is via the web page by hand (i.e. a person doing it, not a program).

I was hoping there was a API that would shutdown the vSphere Replication?

Or is the information about shutting down via a VM and corrupting the backup wrong?

Many thanks,

Matthew

Reply
0 Kudos
ashilkrishnan
VMware Employee
VMware Employee

Hi Matthew,

Corruption would happen if there is a unexpected shutdown/crash due to host/storage/other environment issues or the VM process is force killed.

As long as the VM is shutdown via vCenter or from a ESXi host, it should be good. PowerCLI commands provided earlier connects to vCenter and initiates a VM shutdown

Reply
0 Kudos
hornseym
Contributor
Contributor

Hi @ashilkrishnan

Thank you for the response 🙂

How would I cause a shutdown so that the VM process is not killed? Would a VM shutdown or a GuestOS shutdown be better?

I assume if the vSphere Replication Process is not shutdown in the VM correctly then it's backup process is corrupted?

Many thanks,

Reply
0 Kudos
ashilkrishnan
VMware Employee
VMware Employee

Shutdown/reset/power off of vSphere replication does not cause any corruption to replicated data.

vSphere replication enables the option to configure replication, however once a VM replication is initiated, it's the source ESXi host that starts and finishes the replication jobs. If the vSphere replication appliance is offline, ESXi host will have trouble syncing the next set of data and once the appliance is back online, VM replications can continue.

Reply
0 Kudos
hornseym
Contributor
Contributor

So if I understand what you're saying correctly, the vSphere Replication server monitors the VMs and then tells the ESXi Host to do the replications (e.g. passes it a job)? Do you know of a guide or article that says this? The VMWare guides I've seen so far are unclear to which component is doing what.

Do you know what happens if the ESXi host is shutdown (properly) during a replication; does it finish a job, roll it back or is the job corrupted?

Many thanks,

Reply
0 Kudos
ashilkrishnan
VMware Employee
VMware Employee

In short,

Configure replication from replication UI --> Source ESXi host(where the VM is running) initiates data transmission to target VR --> Target VR selects available host in the cluster to write data on to selected datastore.

Please refer vSphere replication FAQs --> (Questions to refer: If a VMware vSphere host that is performing replication goes offline)

vSphere Replication Frequently Asked Questions (FAQ) - The current version of this doc has moved to:...

vSphere Replication FAQ | VMware

Refer overview and replication process --> vSphere Replication 8.3 Technical Overview | VMware

Hope that helps

Reply
0 Kudos