Hi Paul
The behavior that you're seeing is expected. Also, your observation about SQL Server Delphix implementation is correct. This is where SQL Server and Virtualization Platform (SDK) implementations differ. SQL Server does unmount the storage during stop operation while Virtualization Platform does not. I will describe the rationale behind the Virtualization Platform's implementation below.
The idea with virtual.start()
and virtual.stop()
is to mimic a DBA's workflows for starting and stopping a database. A DBA should be able to stop a database that was started by Delphix and they should be able to start a database that was stopped by Delphix.
To mimic the workflows, we want virtual.start()
to be able to start the database service. In this case, there are two scenarios. One is that Delphix storage is still mounted on the host and all we have to do is start the database service. The other scenario is when the host was restarted and the mount wasn't persisted. In this case we want virtual.start() operation to re-mount the storage and start the database service.
On the flip side, since Delphix doesn't unmount the storage during virtual.stop()
operation, the DBA is able to simply start the database service. If we did unmount the storage, the DBA wouldn't be able to start the database service anymore.
To answer your second question, the status of a VDB is reflected by the result of virtual.status()
script. As described under https://developer.delphix.com/References/Plugin_Operations/#virtual-source-status, if the status script is not implemented, the platform assumes that the status is Status.ACTIVE
.
As for the implementation of virtual.status()
operation, normally you would want to either check whether the database process is running or attempt to log into the database. These are just examples and the method might be different depending on the database. That said, checking if the storage is mounted here will not work because the stop operation won't unmount the storage since the database process might not be running for other reasons (it could have crashed), while the mount could still be present.
-Filip
------------------------------
Filip Drozdowski
Senior Member of Technical Staff I
Delphix
------------------------------
Original Message:
Sent: 01-16-2020 02:21:00 PM
From: Paul Jauquet
Subject: virtual.stop not unmounting
Quick question.
I implemented virtual.stop so that a user can stop the VDB from the UI.
I am calling run_bash to stop the service, and this is working fine
I thought that it would then unmount the VDB? i.e. reverse of virtual.start which mounts it.
I looked at SQL Server and when it stops it also unmounts, so figured it would act in the same way in the SDK.
Is there a call that I need to make to unmount the VDB when stopping?
Also, after the stop completes it shows success but the status remains 'Running'?
Is there a call that I need to make to change the actual status after stop/start?
This is probably related to the post by Eugenio, in that I need to create a status operation.
How do I return the status from virtual.status? return["ACTIVE"] or return["INACTIVE"]? Boolean? Something else?
For a status do I need to add a run_bash to check the OS (i.e. df -k) and then return whether it is mounted?
Thanks,
Paul
------------------------------
Paul Jauquet
Senior Data Services Consultant
Axis Technology, LLC
------------------------------