Instance - Resize the instances based on the shape and CPU utilizationΒΆ

The following example policy will filter the instances that are using VM Standard shape with low CPU utilization. And resize those instances to Flex shape.

  - name: perform-resize-on-compute
    description: Perform resize on the VM's only if the VM is tagged and it's maximum CPU utilization is less than 50%
    resource: oci.instance
      - type: metrics
        query: 'CpuUtilization[1d].max() < 50'
      - type: value
        key: freeform_tags.eligible_for_resize
        value: 'true'
      - type: remove-tag
        freeform_tags: ['eligible_for_resize']
      - type: update
        shape: VM.Standard.E3.Flex
           ocpus: 1