Skip to content

Commit

Permalink
add more debugging info
Browse files Browse the repository at this point in the history
  • Loading branch information
raporpe committed Jan 30, 2023
1 parent 7436098 commit ba43b90
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion defender-for-vm-analyzer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def get_databricks_billable_vms(subscription_id):
if is_databricks_vm:
logger.info("The current VM {} is a Databricks worker".format(vm.name))
else:
logger.info("The current VM {} is not a Databricks worker".format(vm.name))
logger.info("The current VM {} is not a Databricks worker since the VM plan is {}".format(vm.name, vm.plan))
# Skip this VM since it is not a Databricks worker
continue

Expand All @@ -79,7 +79,12 @@ def get_databricks_billable_vms(subscription_id):

# Calculate if this VM is billable
vm_provisioned = vm.provisioning_state == "Succeeded"
if not vm_provisioned:
logger.info("The VM {} is not in Succeeded provisioning state. Current state: {}".format(vm.name, vm.provisioning_state))

vm_running = vm_status.statuses[1].display_status == "VM running"
if not vm_running:
logger.info("The VM {} is not running. Current state: {}".format(vm.name, vm_status.statuses[1].display_status))

billable_databricks_vm = vm_provisioned and \
is_databricks_vm and \
Expand Down

0 comments on commit ba43b90

Please sign in to comment.