Exception: Attempted to divide by zero

Exception: Attempted to divide by zero

Error Details: “Failed due to non-retryable error. Error message: Error creating VM. Operation ‘CreateVM FinishCreateVMOp’ failed. Exception: Attempted to divide by zero.


Step 1: Run the SQL query to get the ComputeInstance have value as 0 for CPUCores

select * from ComputeInstances  where CPUCores = 0


Step 2: Update the values of the CPUCores with actual values:

Update ComputeInstances set CPUCores = <Actual Value of the CPU Cores> where Id = <Id from the above Query>


Or


Step 1: Run the SQL query to get the ComputeInstance have value as 0 for CPUCores

select * from ComputeInstances  where CPUCores = 0


Step 2: Check for unused ComputeInstance causing error, delete that particular ComputeInstance.

 

Step 3: Check if VM is present with this ID:

Select * from VMConfigs where ComputeInstanceId = <Id of the compute instance>


Step 4: Update the compute instance Id of that particular VM before deleting the ComputeInstance

Update VMConfigs Set ComputeInstanceId = <some default ComputeinstanceId> where Id = <Id from the above Query>

 

Step 5: Delete the problem causing Compute Instance

Delete from ComputeInstances where Id = <Id of the compute instance>

Note: The exception "Divide by Zero" is fixed in the recent version of Vconnect.