Skip to content

VM using custom offering and volumes on PowerFlex storage, failed to start after revert to instance snapshot #12790

@sureshanaparti

Description

@sureshanaparti

problem

VM using custom offering and volumes on PowerFlex storage, failed to start after revert to VM snapshot. Start failed with the below exception.

2026-03-11 11:50:44,403 ERROR [c.c.a.ApiAsyncJobDispatcher] (API-Job-Executor-116:[ctx-049286e2, job-10405]) (logid:3feed8a7) Unexpected exception while executing org.apache.cloudstack.api.command.admin.vm.StartVMCmdByAdmin java.lang.NullPointerException: Cannot invoke "java.lang.Integer.intValue()" because the return value of "com.cloud.offering.ServiceOffering.getCpu()" is null
	at com.cloud.deploy.DeploymentPlanningManagerImpl.planDeployment(DeploymentPlanningManagerImpl.java:314)
	at org.apache.cloudstack.engine.cloud.entity.api.VMEntityManagerImpl.reserveVirtualMachine(VMEntityManagerImpl.java:207)
	at org.apache.cloudstack.engine.cloud.entity.api.VirtualMachineEntityImpl.reserve(VirtualMachineEntityImpl.java:202)
	at com.cloud.vm.UserVmManagerImpl.startVirtualMachine(UserVmManagerImpl.java:5823)
	at com.cloud.vm.UserVmManagerImpl.startVirtualMachine(UserVmManagerImpl.java:5676)
	at com.cloud.vm.UserVmManagerImpl.startVirtualMachine(UserVmManagerImpl.java:3382)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:569)
	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
	at org.apache.cloudstack.network.contrail.management.EventUtils$EventInterceptor.invoke(EventUtils.java:109)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:175)
	at com.cloud.event.ActionEventInterceptor.invoke(ActionEventInterceptor.java:52)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:175)
	at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:215)
	at jdk.proxy3/jdk.proxy3.$Proxy219.startVirtualMachine(Unknown Source)
	at org.apache.cloudstack.api.command.user.vm.StartVMCmd.execute(StartVMCmd.java:183)

Image

The custom offering details after removed from vm_instance_details table during revert operation.

Before Revert to instance snapshot:

mysql> SELECT * FROM cloud.vm_instance_details WHERE vm_id = 23;
+-----+-------+------------------------------------+-------+---------+
| id  | vm_id | name                               | value | display |
+-----+-------+------------------------------------+-------+---------+
| 132 |    23 | cpuNumber                          | 1     |       1 |
| 133 |    23 | cpuOvercommitRatio                 | 2.0   |       1 |
| 135 |    23 | cpuSpeed                           | 500   |       1 |
| 134 |    23 | memory                             | 512   |       1 |
| 136 |    23 | Message.ReservedCapacityFreed.Flag | false |       1 |
+-----+-------+------------------------------------+-------+---------+
5 rows in set (0.00 sec)

After Revert to instance snapshot:

mysql> SELECT * FROM cloud.vm_instance_details WHERE vm_id = 23;
+-----+-------+-----------------+-----------------------------------------+---------+
| id  | vm_id | name            | value                                   | display |
+-----+-------+-----------------+-----------------------------------------+---------+
| 137 |    23 | SnapshotGroupId | 47b8a69a00000002                        |       0 |
| 138 |    23 | Vol_34_Snapshot | 8a4ca4560000003d:vmsnap-10-34-1c6c-b24c |       0 |
| 139 |    23 | Vol_35_Snapshot | 8a4ca4570000003e:vmsnap-10-35-1c6c-b24c |       0 |
+-----+-------+-----------------+-----------------------------------------+---------+
3 rows in set (0.00 sec)

versions

ACS 4.22.0 + KVM + PowerFlex storage

The steps to reproduce the bug

  1. Create an instance using custom offering on PowerFlex storage.
  2. Take instance snapshot for the instance created in the step 1.
  3. Stop the instance.
  4. Revert to the instance snapshot created in step 2.
  5. Start the instance

What to do about it?

The instance should start after revert to the instance snapshot.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions