AWS cloud volume relationships

hello I am stuck on some proviosing and relationship building around amazon ebs and instances.
using rails console I can simply
vm = Vm.find_by_name(“VMNAME”)
vol = vm.cloud_volumes.first
vol.create_volume_snapshot(name: “idtest”)

and this all works fine.
however using automate I can not seem to get this to work.
I have tried all kinds of different ways to load the vm object and not only is the cloud_volumes method not available I can’t seem to output any actual volume info.

Any help is appreciated.


Hello, for Automate, there is a special wrapper object, that needs to have the relation and action exposed.


we need:
expose :cloud_volumes, :association => true

And here

so adding line:
expose :create_volume_snapshot, :override_return => nil

after restarting the appliance, it should work also in automate (just the find_by_name is different syntax)

Can you fill a GitHub issue or Bugzilla on Automate missing these as exposed? Or you can send even a Pull Request with the changes, it they’ll work. :slight_smile:

Thanks. I made changes locally and verified everything works as it should. This is great!