Virtualization Plugins

Expand all | Collapse all

virtual.stop not unmounting

Jump to Best Answer
  • 1.  virtual.stop not unmounting

    Posted 01-16-2020 01:21:00 PM
    Edited by Paul Jauquet 01-16-2020 03:44:17 PM
    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?
    VirtualStartStopFlows

    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
    ------------------------------


  • 2.  RE: virtual.stop not unmounting
    Best Answer

    Posted 01-16-2020 04:18:00 PM

    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
    ------------------------------



  • 3.  RE: virtual.stop not unmounting

    Posted 01-16-2020 11:05:00 PM
    A few more questions on this topic.   
    1. I implemented virtual.stop, but after I run stop it looks like it succeeds but the status remains 'Running'.   Note that the underlying database processes were stopped as expected, it's just the status does not change.  So now you are in a state where the UI says it is Running but it is actually down.  Do you need to implement status in order for this to work?  If so that leads me to my second question.
    2. I tried to implement virtual.status but I cannot figure out how to return whether it is running or not.  What would I return for each?

    Thanks, Paul

    ------------------------------
    Paul Jauquet
    Senior Data Services Consultant
    Axis Technology, LLC
    ------------------------------



  • 4.  RE: virtual.stop not unmounting

    Posted 01-16-2020 11:50:00 PM
    1. Yes, you will have to implement virtual.status() operation. Otherwise, the Delphix UI won't be able to display the appropriate status and will always show "Running".
    2. For a running VDB, you would return Status.ACTIVE. For a stopped VDB, you would return Status.INACTIVE (https://developer.delphix.com/References/Plugin_Operations/#virtual-source-status).

    ------------------------------
    Filip Drozdowski
    Senior Member of Technical Staff I
    Delphix
    ------------------------------



  • 5.  RE: virtual.stop not unmounting

    Posted 01-17-2020 04:21:00 PM
    It is working now.  Thanks!

    ------------------------------
    Paul Jauquet
    Senior Data Services Consultant
    Axis Technology, LLC
    ------------------------------