AnykeyNL / OCI-AutoScale

Automatic Scaling for OCI BM Database Cloud Service (Schedule based)
Universal Permissive License v1.0
113 stars 67 forks source link

Broken Instance Scaling #35

Closed flynnkc closed 8 months ago

flynnkc commented 10 months ago

Observed script failure on E4.Flex compute shape instance with 2 OCPUs.

Behavior reproduced in test environment: E4.Flex instance 2 OCPUs 8GB Memory

  1. Starting State: RUNNING -- 2 OCUPs on Instance Details
  2. Scaled down with active tag [0]: STOPPED -- 2 OCPUs on Instance Details
  3. Scaled up with active tag [2]: STOPPED -- 2 OCPUs on Instance Details
  4. Scaled up with active tag [1]: RUNNING -- 2 OCPUs on Instance Details
  5. Scaled up with active tag [3]: RUNNING -- 2 OCPUs on Instance Details

It appears that scaling for compute instances is not working as intended. I have not yet tested other shapes or services.

Audit entry for step 5 below: { "eventType": "com.oraclecloud.computeApi.UpdateInstance", "cloudEventsVersion": "0.1", "eventTypeVersion": "2.0", "source": "computeApi", "eventId": "###", "eventTime": "2023-11-17T19:00:32.318Z", "contentType": "application/json", "data": { "eventGroupingId": "###", "eventName": "UpdateInstance", "compartmentId": "ocid1.compartment.oc1..###", "compartmentName": "###", "resourceName": "instance-20231117-1345", "resourceId": "ocid1.instance.oc1.ca-montreal-1.###", "availabilityDomain": "AD1", "freeformTags": {}, "definedTags": { "Schedule": { "AnyDay": "3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3" } }, "identity": { "principalName": "KC Flynn", "principalId": "ocid1.user.oc1..###", "authType": "natv", "callerName": null, "callerId": null, "tenantId": "ocid1.tenancy.oc1..###", "ipAddress": "###", "credentials": "###", "userAgent": "###", "consoleSessionId": "###" }, "request": { "id": "###", "action": "PUT", "parameters": {}, "headers": { "Accept": [ "*/*" ], "Connection": [ "keep-alive" ], "DNT": [ "1" ], "Origin": [ "https://cloud.oracle.com" ], "Referer": [ "https://cloud.oracle.com/" ] } }, "response": { "status": "200", "responseTime": "2023-11-17T19:00:32.318Z", "headers": { "Access-Control-Allow-Credentials": [ "true" ], "Access-Control-Allow-Origin": [ "https://cloud.oracle.com" ], "Access-Control-Expose-Headers": [ "opc-previous-page,opc-next-page,opc-client-info,ETag,opc-total-items,opc-request-id,Location" ], "Connection": [ "keep-alive" ], "Content-Length": [ "3840" ], "Content-Type": [ "application/json" ], "Date": [ "Fri, 17 Nov 2023 19:00:32 GMT" ], "ETag": [ "###" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains;" ], "Timing-Allow-Origin": [ "https://cloud.oracle.com" ], "Vary": [ "Origin" ], "X-Content-Type-Options": [ "nosniff" ], "X-Frame-Options": [ "SAMEORIGIN" ], "opc-request-id": [ "###" ], "opc-work-request-id": [ "###" ] }, "payload": {}, "message": "instance-20231117-1345 UpdateInstance succeeded" }, "stateChange": { "previous": { "agentConfig": { "areAllPluginsDisabled": false, "isManagementDisabled": false, "isMonitoringDisabled": false, "pluginsConfig": [ { "desiredState": "DISABLED", "name": "Vulnerability Scanning" }, { "desiredState": "DISABLED", "name": "Oracle Java Management Service" }, { "desiredState": "ENABLED", "name": "OS Management Service Agent" }, { "desiredState": "DISABLED", "name": "Management Agent" }, { "desiredState": "ENABLED", "name": "Custom Logs Monitoring" }, { "desiredState": "DISABLED", "name": "Compute RDMA GPU Monitoring" }, { "desiredState": "ENABLED", "name": "Compute Instance Run Command" }, { "desiredState": "ENABLED", "name": "Compute Instance Monitoring" }, { "desiredState": "DISABLED", "name": "Compute HPC RDMA Auto-Configuration" }, { "desiredState": "DISABLED", "name": "Compute HPC RDMA Authentication" }, { "desiredState": "DISABLED", "name": "Block Volume Management" }, { "desiredState": "DISABLED", "name": "Bastion" } ] }, "availabilityConfig": { "isLiveMigrationPreferred": true, "recoveryAction": "RESTORE_INSTANCE" }, "availabilityDomain": "uFjs:CA-MONTREAL-1-AD-1", "compartmentId": "ocid1.compartment.oc1..###", "definedTags": "Schedule": { "AnyDay": "1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1", "Weekend": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" } }, "displayName": "instance-20231117-1345", "extendedMetadata": {}, "faultDomain": "FAULT-DOMAIN-3", "freeformTags": {}, "id": "ocid1.instance.oc1.ca-montreal-1.###", "imageId": "ocid1.image.oc1.ca-montreal-1.###", "instanceOptions": { "areLegacyImdsEndpointsDisabled": false }, "isCrossNumaNode": false, "launchMode": "PARAVIRTUALIZED", "launchOptions": { "bootVolumeType": "PARAVIRTUALIZED", "firmware": "UEFI_64", "isConsistentVolumeNamingEnabled": true, "isPvEncryptionInTransitEnabled": false, "networkType": "PARAVIRTUALIZED", "remoteDataVolumeType": "PARAVIRTUALIZED" }, "lifecycleState": "RUNNING", "metadata": {}, "region": "ca-montreal-1", "shape": "VM.Standard.E4.Flex", "shapeConfig": { "baselineOcpuUtilization": "BASELINE_1_1", "gpus": 0, "localDisks": 0, "maxVnicAttachments": 2, "memoryInGBs": 8, "networkingBandwidthInGbps": 2, "ocpus": 2, "processorDescription": "2.55 GHz AMD EPYC? 7J13 (Milan)", "vcpus": 4 }, "sourceDetails": { "imageId": "ocid1.image.oc1.ca-montreal-1.###", "sourceType": "image" }, "systemTags": {}, "timeCreated": "2023-11-17T18:46:45.909Z" }, "current": { "agentConfig": { "areAllPluginsDisabled": false, "isManagementDisabled": false, "isMonitoringDisabled": false, "pluginsConfig": [ { "desiredState": "DISABLED", "name": "Vulnerability Scanning" }, { "desiredState": "DISABLED", "name": "Oracle Java Management Service" }, { "desiredState": "ENABLED", "name": "OS Management Service Agent" }, { "desiredState": "DISABLED", "name": "Management Agent" }, { "desiredState": "ENABLED", "name": "Custom Logs Monitoring" }, { "desiredState": "DISABLED", "name": "Compute RDMA GPU Monitoring" }, { "desiredState": "ENABLED", "name": "Compute Instance Run Command" }, { "desiredState": "ENABLED", "name": "Compute Instance Monitoring" }, { "desiredState": "DISABLED", "name": "Compute HPC RDMA Auto-Configuration" }, { "desiredState": "DISABLED", "name": "Compute HPC RDMA Authentication" }, { "desiredState": "DISABLED", "name": "Block Volume Management" }, { "desiredState": "DISABLED", "name": "Bastion" } ] }, "availabilityConfig": { "isLiveMigrationPreferred": true, "recoveryAction": "RESTORE_INSTANCE" }, "availabilityDomain": "uFjs:CA-MONTREAL-1-AD-1", "compartmentId": "ocid1.compartment.oc1..###", "definedTags": { "Schedule": { "AnyDay": "3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3", "Weekend": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" } }, "displayName": "instance-20231117-1345", "extendedMetadata": {}, "faultDomain": "FAULT-DOMAIN-3", "freeformTags": {}, "id": "ocid1.instance.oc1.ca-montreal-1.###", "imageId": "ocid1.image.oc1.ca-montreal-1.###", "instanceOptions": { "areLegacyImdsEndpointsDisabled": false }, "isCrossNumaNode": false, "launchMode": "PARAVIRTUALIZED", "launchOptions": { "bootVolumeType": "PARAVIRTUALIZED", "firmware": "UEFI_64", "isConsistentVolumeNamingEnabled": true, "isPvEncryptionInTransitEnabled": false, "networkType": "PARAVIRTUALIZED", "remoteDataVolumeType": "PARAVIRTUALIZED" }, "lifecycleState": "RUNNING", "metadata": {}, "region": "ca-montreal-1", "shape": "VM.Standard.E4.Flex", "shapeConfig": { "baselineOcpuUtilization": "BASELINE_1_1", "gpus": 0, "localDisks": 0, "maxVnicAttachments": 2, "memoryInGBs": 8, "networkingBandwidthInGbps": 2, "ocpus": 2, "processorDescription": "2.55 GHz AMD EPYC? 7J13 (Milan)", "vcpus": 4 }, "sourceDetails": { "imageId": "ocid1.image.oc1.ca-montreal-1.###", "sourceType": "image" }, "systemTags": {}, "timeCreated": "2023-11-17T18:46:45.909Z" } }, "additionalDetails": { "X-Real-Port": 55611, "imageId": "ocid1.image.oc1.ca-montreal-1.###", "shape": "VM.Standard.E4.Flex", "type": "CustomerVmi", "volumeId": "null" } } }

AnykeyNL commented 8 months ago

For VM power on/off use the value 0 / 1

If you want to resize a Flex shape, you have to specify: (core,memory)

so for example if you want the VM to go to 3 cores and 16GB ram at 3am, specify: ,,(3:16),,,,,(2:8),,,,,,,,,,0,,,,1,