apache / cloudstack

Apache CloudStack is an opensource Infrastructure as a Service (IaaS) cloud computing platform
https://cloudstack.apache.org/
Apache License 2.0
2.05k stars 1.1k forks source link

Unable to delete the VolumeSnapshots in Backing up state #8423

Closed kiranchavala closed 8 months ago

kiranchavala commented 9 months ago

ISSUE TYPE

Bug

COMPONENT NAME

Component: Bug

CLOUDSTACK VERSION

Cloudstack version 4.18

SUMMARY

Unable to delete the VolumeSnapshots in Backing up state

Steps to reproduce the behaviour

  1. launch a vm with root disk

  2. Take a vm-snapshot

  3. Create a Snapshot from the VM-Snapshot

https://cloudstack.apache.org/api/apidocs-4.18/apis/createSnapshotFromVMSnapshot.html

snapshot-from vmsnapshot

  1. Stop the management server

  2. Navigate to the database, and check the snapshots table, the snapshot

*************************** 8. row ***************************
              id: 8
  data_center_id: 1
      account_id: 2
       domain_id: 1
       volume_id: 65
disk_offering_id: 1
          status: BackingUp
            path: NULL
            name: ui-snap
            uuid: baf5eb2f-575b-4ad5-9dbb-a1395d6108eb
   snapshot_type: 0
type_description: MANUAL
            size: 8589934592
         created: 2024-01-01 12:00:13
         removed: NULL
  backup_snap_id: NULL
        swift_id: NULL
      sechost_id: NULL
    prev_snap_id: NULL
 hypervisor_type: KVM
         version: 2.2
        min_iops: NULL
        max_iops: NULL
   location_type: NULL
  1. Start the Management server

  2. Navigate to the U

Storage > VolumeSnapshots >

The Volume snapshots will be in backing up state

Screenshot 2024-01-01 at 5 37 15 PM

  1. Try to delete the Volume Snapshots in backing up state

Exception

2024-01-01 12:08:46,712 DEBUG [o.a.c.s.s.StorPoolSnapshotStrategy] (API-Job-Executor-1:ctx-d6f5072a job-366 ctx-a09b8e7b) (logid:5a6981c5) StorpoolSnapshotStrategy.canHandle: snapshot=ui-snap, uuid=baf5eb2f-575b-4ad5-9dbb-a1395d6108eb, op=DELETE
2024-01-01 12:08:46,726 DEBUG [c.c.s.s.SnapshotManagerImpl] (API-Job-Executor-1:ctx-d6f5072a job-366 ctx-a09b8e7b) (logid:5a6981c5) Failed to delete snapshot: 8:com.cloud.exception.InvalidParameterValueException: Can't delete snapshotshot 8 due to it is in BackingUp Status
2024-01-01 12:08:46,732 ERROR [c.c.a.ApiAsyncJobDispatcher] (API-Job-Executor-1:ctx-d6f5072a job-366) (logid:5a6981c5) Unexpected exception while executing org.apache.cloudstack.api.command.user.snapshot.DeleteSnapshotCmd
com.cloud.utils.exception.CloudRuntimeException: Failed to delete snapshot:com.cloud.exception.InvalidParameterValueException: Can't delete snapshotshot 8 due to it is in BackingUp Status
    at com.cloud.storage.snapshot.SnapshotManagerImpl.deleteSnapshot(SnapshotManagerImpl.java:741)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    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:107)
    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 com.sun.proxy.$Proxy224.deleteSnapshot(Unknown Source)
    at org.apache.cloudstack.api.command.user.snapshot.DeleteSnapshotCmd.execute(DeleteSnapshotCmd.java:106)
    at com.cloud.api.ApiDispatcher.dispatch(ApiDispatcher.java:172)
    at com.cloud.api.ApiAsyncJobDispatcher.runJob(ApiAsyncJobDispatcher.java:112)
    at org.apache.cloudstack.framework.jobs.impl.AsyncJobManagerImpl$5.runInContext(AsyncJobManagerImpl.java:632)
    at org.apache.cloudstack.managed.context.ManagedContextRunnable$1.run(ManagedContextRunnable.java:48)
    at org.apache.cloudstack.managed.context.impl.DefaultManagedContext$1.call(DefaultManagedContext.java:55)
    at org.apache.cloudstack.managed.context.impl.DefaultManagedContext.callWithContext(DefaultManagedContext.java:102)
    at org.apache.cloudstack.managed.context.impl.DefaultManagedContext.runWithContext(DefaultManagedContext.java:52)
    at org.apache.cloudstack.managed.context.ManagedContextRunnable.run(ManagedContextRunnable.java:45)
    at org.apache.cloudstack.framework.jobs.impl.AsyncJobManagerImpl$5.run(AsyncJobManagerImpl.java:580)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:829)

Actual Behaviour

Cloudstack Is not able to delete the VolumeSnapshots in Backing up state

Expected Behaviour

Cloudstack should be able to delete the VolumeSnapshots in Backing up state or Cloudstack should mark the volumeSnapshots in destory state and mark them removed so that it's not displayed in the UI

kiranchavala commented 9 months ago

This could be part of the upcoming PR fix

https://github.com/apache/cloudstack/pull/8394

DaanHoogland commented 8 months ago

This could be part of the upcoming PR fix

8394

can you comment on the state of the issue after it was merged @kiranchavala ?

shwstppr commented 8 months ago

Closing this based on https://github.com/apache/cloudstack/issues/8423#issuecomment-1873303188 and merged PR #8394