module MiqAeMethodService
  class MiqAeServiceManageIQ_Providers_Openstack_CloudManager_Vm < MiqAeServiceVmCloud
    expose :cloud_networks, :association => true

    expose :resize,         :override_return => nil
    expose :resize_confirm, :override_return => nil
    expose :resize_revert,  :override_return => nil

    expose :validate_resize
    expose :validate_resize_confirm
    expose :validate_resize_revert

    def attach_volume(volume_id, device = nil, options = {})
      sync_or_async_ems_operation(options[:sync], "attach_volume", [volume_id, device])
    end

    def detach_volume(volume_id, options = {})
      sync_or_async_ems_operation(options[:sync], "detach_volume", [volume_id])
    end

  end
end

module MiqAeMethodService
  class MiqAeServiceManageIQ_Providers_Openstack_CloudManager_Vm < MiqAeServiceVmCloud
    expose :cloud_networks, :association => true

    expose :resize,         :override_return => nil
    expose :resize_confirm, :override_return => nil
    expose :resize_revert,  :override_return => nil

    expose :supports_resize?
    expose :validate_resize_confirm
    expose :validate_resize_revert

    def attach_volume(volume_id, device = nil, options = {})
      sync_or_async_ems_operation(options[:sync], "attach_volume", [volume_id, device])
    end

    def detach_volume(volume_id, options = {})
      sync_or_async_ems_operation(options[:sync], "detach_volume", [volume_id])
    end

    def validate_resize
      {:available => supports_resize?, :message => unsupported_reason(:resize)}
    end
  end
end

Use SupportsFeatureMixin for querrying VM for resize operation
Use SupportsFeatureMixin for querrying VM for resize operation


(transferred from ManageIQ/manageiq@4e7604885c7890b21ad3a6a7e7a2e9437219be37)
