Persistant data in a Cloud Plugin and other questions

I’m writing a custom Cloud Plugin and I have a few questions.

  1. I need to retain some data about my cloud instances. I can’t store it on the object (self), the class (CloudPluginWrapper) or as a module global as it seems everything is reinstanciated every time one of the methods is called. I want to store some details when CreateInstances() is called and use those details when GetActiveInstances() is called. Is there a mechanism I can use for this?

  2. Is it possible to query the ‘Region’ name from inside the Cloud Plugin?

  1. Yes, if you are using our existing cloud plugins for reference the instance information that is stored, the instance information on the CloudInstance object does not persist and its retrieved from the your cloud connection obj on every GetActiveInstances call. This is to get the latest version and avoid stale data. Also, the cloudplugins should not have any blocking code that waits for users input, so modifying this to persist information between the Createinstances and GetActiveInstances is not recommended.
    If you want to really store the information on Deadline database, you need to link your instance to a worker and then do it on the slaveinfo or slavesettings object and save to Database calling the SaveSlaveInfo/SaveSlaveSettings.
    Can you tell me what info exactly you want to store that cannot be accessed in the GetActiveInstances call? May be I can suggest an alternative for the desired result.

  2. I think this depends on the cloud provider you are using. Typically you would have this on your cloud sdk or a python package and you could simply add that package to Deadline and query using its api. You can add external python dependences in repository options-> python settings. For default region values, you can set it on the .param file.

  1. My provider can have many instances running… some are for Deadline and some are for other purposes. I get a GUID when I launch them. I want to retain this somewhere when CreateInstances() is called so that when I call GetActiveInstances() I only query for the GUIDs that are intended for Deadline. I’m limited on the provider side, so I can’t query/ask the provider for only my Deadline instances.

  2. By ‘Region’ I meant the value that the user enters when creating a new Cloud Region (via the Configure Cloud Providers dialog)