Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to attach a uploaded disk to a vm as a root disk or as a data disk when there are no disk associated with the vm #10120

Open
kiranchavala opened this issue Dec 18, 2024 · 0 comments

Comments

@kiranchavala
Copy link
Contributor

ISSUE TYPE

BUG

COMPONENT NAME

Component: Bug

CLOUDSTACK VERSION

Cloudstack version 4.19.1.x

SUMMARY

Unable to attach a uploaded disk to a vm as a root disk or as a data disk when there are no disks associated with the vm.

This is also related to #8752

Steps to reproduce the issue

  1. Launch 2 Cloudstack instances (vm1 and vm2) with only root disk in the same admin account.
  2. Stop the instances (vm1 and vm2) and detach the root disk associated with the vm's (vm1 and vm2)
  3. Download the root disk of vm1 to you local desktop
  4. Upload the root disk of vm1 to the admin account. The state of the volume will be in Uploaded state
  5. Attach the uploaded root disk of vm 1 to vm 2(Make sure to attach it as device id 0)
  6. Exception observed (No support for Root volume attach in state Uploaded)
  7. Attach the uploaded root disk of vm 1 to vm 2( Make sure to attach it as device id 1) i.e basically as a data disk
  8. Exception observed (Volume: "xxx" is in Uploaded. It should be in Ready or Allocated state)

Logs

Attach the uploaded volume to vm as root disk

[root@ol8 ~]# cat  /var/log/cloudstack/management/management-server.log |grep -i "logid:37085e62"
2024-12-18 06:56:21,235 DEBUG [o.a.c.f.j.i.AsyncJobManagerImpl] (API-Job-Executor-66:ctx-193cbdc0 job-116) (logid:37085e62) Executing AsyncJobVO: {id:116, userId: 2, accountId: 2, instanceType: Volume, instanceId: 14, cmd: org.apache.cloudstack.api.command.admin.volume.AttachVolumeCmdByAdmin, cmdInfo: {"virtualmachineid":"2a16a8b3-ba2e-4e17-8f2a-252a779e7005","response":"json","ctxUserId":"2","sessionkey":"-ky-PMorCDrSP3k4t4ISN6nTIZw","httpmethod":"GET","ctxStartEventId":"251","id":"bbbdb242-2af2-4a18-b18a-7b456f6dd6af","ctxDetails":"{\"interface com.cloud.storage.Volume\":\"bbbdb242-2af2-4a18-b18a-7b456f6dd6af\",\"interface com.cloud.vm.VirtualMachine\":\"2a16a8b3-ba2e-4e17-8f2a-252a779e7005\"}","deviceid":"0","ctxAccountId":"2","uuid":"bbbdb242-2af2-4a18-b18a-7b456f6dd6af","cmdEventType":"VOLUME.ATTACH"}, cmdVersion: 0, status: IN_PROGRESS, processStatus: 0, resultCode: 0, result: null, initMsid: 32988905604137, completeMsid: null, lastUpdated: null, lastPolled: null, created: null, removed: null}
2024-12-18 06:56:21,242 DEBUG [c.c.u.AccountManagerImpl] (API-Job-Executor-66:ctx-193cbdc0 job-116 ctx-8b4705c5) (logid:37085e62) Account [1ff04c58-bcfd-11ef-8d56-1e00d4000429] has access to resource.
2024-12-18 06:56:21,261 DEBUG [o.a.c.f.j.i.AsyncJobManagerImpl] (API-Job-Executor-66:ctx-193cbdc0 job-116) (logid:37085e62) Complete async job-116, jobStatus: FAILED, resultCode: 431, result: org.apache.cloudstack.api.response.ExceptionResponse/null/{"uuidList":[],"errorcode":"431","errortext":"No support for Root volume attach in state Uploaded"}
2024-12-18 06:56:21,262 DEBUG [o.a.c.f.j.i.AsyncJobManagerImpl] (API-Job-Executor-66:ctx-193cbdc0 job-116) (logid:37085e62) Publish async job-116 complete on message bus
2024-12-18 06:56:21,262 DEBUG [o.a.c.f.j.i.AsyncJobManagerImpl] (API-Job-Executor-66:ctx-193cbdc0 job-116) (logid:37085e62) Wake up jobs related to job-116
2024-12-18 06:56:21,262 DEBUG [o.a.c.f.j.i.AsyncJobManagerImpl] (API-Job-Executor-66:ctx-193cbdc0 job-116) (logid:37085e62) Update db status for job-116
2024-12-18 06:56:21,262 DEBUG [o.a.c.f.j.i.AsyncJobManagerImpl] (API-Job-Executor-66:ctx-193cbdc0 job-116) (logid:37085e62) Wake up jobs joined with job-116 and disjoin all subjobs created from job- 116
2024-12-18 06:56:21,267 DEBUG [o.a.c.f.j.i.AsyncJobManagerImpl] (API-Job-Executor-66:ctx-193cbdc0 job-116) (logid:37085e62) Done executing org.apache.cloudstack.api.command.admin.volume.AttachVolumeCmdByAdmin for job-116
2024-12-18 06:56:21,268 INFO  [o.a.c.f.j.i.AsyncJobMonitor] (API-Job-Executor-66:ctx-193cbdc0 job-116) (logid:37085e62) Remove job-116 from job monitoring

Attach the uploaded volume to vm as data disk

[root@ol8 ~]# cat  /var/log/cloudstack/management/management-server.log |grep -i "logid:d30252c8"
2024-12-18 06:57:57,991 DEBUG [o.a.c.f.j.i.AsyncJobManagerImpl] (API-Job-Executor-67:ctx-9a295591 job-117) (logid:d30252c8) Executing AsyncJobVO: {id:117, userId: 2, accountId: 2, instanceType: Volume, instanceId: 14, cmd: org.apache.cloudstack.api.command.admin.volume.AttachVolumeCmdByAdmin, cmdInfo: {"virtualmachineid":"2a16a8b3-ba2e-4e17-8f2a-252a779e7005","response":"json","ctxUserId":"2","sessionkey":"-ky-PMorCDrSP3k4t4ISN6nTIZw","httpmethod":"GET","ctxStartEventId":"254","id":"bbbdb242-2af2-4a18-b18a-7b456f6dd6af","ctxDetails":"{\"interface com.cloud.storage.Volume\":\"bbbdb242-2af2-4a18-b18a-7b456f6dd6af\",\"interface com.cloud.vm.VirtualMachine\":\"2a16a8b3-ba2e-4e17-8f2a-252a779e7005\"}","ctxAccountId":"2","uuid":"bbbdb242-2af2-4a18-b18a-7b456f6dd6af","cmdEventType":"VOLUME.ATTACH"}, cmdVersion: 0, status: IN_PROGRESS, processStatus: 0, resultCode: 0, result: null, initMsid: 32988905604137, completeMsid: null, lastUpdated: null, lastPolled: null, created: null, removed: null}
2024-12-18 06:57:58,001 DEBUG [c.c.u.AccountManagerImpl] (API-Job-Executor-67:ctx-9a295591 job-117 ctx-9b0fa450) (logid:d30252c8) Account [1ff04c58-bcfd-11ef-8d56-1e00d4000429] has access to resource.
2024-12-18 06:57:58,025 INFO  [c.c.s.VolumeApiServiceImpl] (API-Job-Executor-67:ctx-9a295591 job-117 ctx-9b0fa450) (logid:d30252c8) Trying to attach volume [test8/bbbdb242-2af2-4a18-b18a-7b456f6dd6af] to VM instance [i-2-7-VM/2a16a8b3-ba2e-4e17-8f2a-252a779e7005], update async job-117 progress status
2024-12-18 06:57:58,026 DEBUG [o.a.c.f.j.i.AsyncJobManagerImpl] (API-Job-Executor-67:ctx-9a295591 job-117 ctx-9b0fa450) (logid:d30252c8) Update async-job attachment, job-117, instanceType: Volume, instanceId: 14
2024-12-18 06:57:58,038 DEBUG [o.a.c.f.j.i.AsyncJobManagerImpl] (API-Job-Executor-67:ctx-9a295591 job-117 ctx-9b0fa450) (logid:d30252c8) Sync job-118 execution on object VmWorkJobQueue.7
2024-12-18 06:57:58,050 DEBUG [c.c.s.VolumeApiServiceImpl] (API-Job-Executor-67:ctx-9a295591 job-117 ctx-9b0fa450) (logid:d30252c8) New job 118, result field: null
2024-12-18 06:57:58,678 DEBUG [o.a.c.f.j.i.AsyncJobManagerImpl] (Work-Job-Executor-44:ctx-45531ac1 job-117/job-118) (logid:d30252c8) Executing AsyncJobVO: {id:118, userId: 2, accountId: 2, instanceType: null, instanceId: null, cmd: com.cloud.vm.VmWorkAttachVolume, cmdInfo: rO0ABXNyAB9jb20uY2xvdWQudm0uVm1Xb3JrQXR0YWNoVm9sdW1lB62v-WGH4hwCAAJMAAhkZXZpY2VJZHQAEExqYXZhL2xhbmcvTG9uZztMAAh2b2x1bWVJZHEAfgABeHIAE2NvbS5jbG91ZC52bS5WbVdvcmufmbZW8CVnawIABEoACWFjY291bnRJZEoABnVzZXJJZEoABHZtSWRMAAtoYW5kbGVyTmFtZXQAEkxqYXZhL2xhbmcvU3RyaW5nO3hwAAAAAAAAAAIAAAAAAAAAAgAAAAAAAAAHdAAUVm9sdW1lQXBpU2VydmljZUltcGxwc3IADmphdmEubGFuZy5Mb25nO4vkkMyPI98CAAFKAAV2YWx1ZXhyABBqYXZhLmxhbmcuTnVtYmVyhqyVHQuU4IsCAAB4cAAAAAAAAAAO, cmdVersion: 0, status: IN_PROGRESS, processStatus: 0, resultCode: 0, result: null, initMsid: 32988905604137, completeMsid: null, lastUpdated: null, lastPolled: null, created: Wed Dec 18 06:57:58 UTC 2024, removed: null}
2024-12-18 06:57:58,678 DEBUG [c.c.v.VmWorkJobDispatcher] (Work-Job-Executor-44:ctx-45531ac1 job-117/job-118) (logid:d30252c8) Run VM work job: com.cloud.vm.VmWorkAttachVolume for VM 7, job origin: 117
2024-12-18 06:57:58,681 DEBUG [c.c.v.VmWorkJobHandlerProxy] (Work-Job-Executor-44:ctx-45531ac1 job-117/job-118 ctx-065a3412) (logid:d30252c8) Execute VM work job: com.cloud.vm.VmWorkAttachVolume{"volumeId":14,"userId":2,"accountId":2,"vmId":7,"handlerName":"VolumeApiServiceImpl"}
2024-12-18 06:57:58,696 DEBUG [c.c.v.VirtualMachineManagerImpl] (Work-Job-Executor-44:ctx-45531ac1 job-117/job-118 ctx-065a3412) (logid:d30252c8) host id is null, using last host id 2
2024-12-18 06:57:58,703 ERROR [c.c.s.VolumeApiServiceImpl] (Work-Job-Executor-44:ctx-45531ac1 job-117/job-118 ctx-065a3412) (logid:d30252c8) Volume: test8 is in Uploaded. It should be in Ready or Allocated state
2024-12-18 06:57:58,703 ERROR [c.c.v.VmWorkJobHandlerProxy] (Work-Job-Executor-44:ctx-45531ac1 job-117/job-118 ctx-065a3412) (logid:d30252c8) Invocation exception, caused by: com.cloud.utils.exception.CloudRuntimeException: Volume: test8 is in Uploaded. It should be in Ready or Allocated state
2024-12-18 06:57:58,703 INFO  [c.c.v.VmWorkJobHandlerProxy] (Work-Job-Executor-44:ctx-45531ac1 job-117/job-118 ctx-065a3412) (logid:d30252c8) Rethrow exception com.cloud.utils.exception.CloudRuntimeException: Volume: test8 is in Uploaded. It should be in Ready or Allocated state
2024-12-18 06:57:58,703 DEBUG [c.c.v.VmWorkJobDispatcher] (Work-Job-Executor-44:ctx-45531ac1 job-117/job-118) (logid:d30252c8) Done with run of VM work job: com.cloud.vm.VmWorkAttachVolume for VM 7, job origin: 117
2024-12-18 06:57:58,703 ERROR [c.c.v.VmWorkJobDispatcher] (Work-Job-Executor-44:ctx-45531ac1 job-117/job-118) (logid:d30252c8) Unable to complete AsyncJobVO: {id:118, userId: 2, accountId: 2, instanceType: null, instanceId: null, cmd: com.cloud.vm.VmWorkAttachVolume, cmdInfo: rO0ABXNyAB9jb20uY2xvdWQudm0uVm1Xb3JrQXR0YWNoVm9sdW1lB62v-WGH4hwCAAJMAAhkZXZpY2VJZHQAEExqYXZhL2xhbmcvTG9uZztMAAh2b2x1bWVJZHEAfgABeHIAE2NvbS5jbG91ZC52bS5WbVdvcmufmbZW8CVnawIABEoACWFjY291bnRJZEoABnVzZXJJZEoABHZtSWRMAAtoYW5kbGVyTmFtZXQAEkxqYXZhL2xhbmcvU3RyaW5nO3hwAAAAAAAAAAIAAAAAAAAAAgAAAAAAAAAHdAAUVm9sdW1lQXBpU2VydmljZUltcGxwc3IADmphdmEubGFuZy5Mb25nO4vkkMyPI98CAAFKAAV2YWx1ZXhyABBqYXZhLmxhbmcuTnVtYmVyhqyVHQuU4IsCAAB4cAAAAAAAAAAO, cmdVersion: 0, status: IN_PROGRESS, processStatus: 0, resultCode: 0, result: null, initMsid: 32988905604137, completeMsid: null, lastUpdated: null, lastPolled: null, created: Wed Dec 18 06:57:58 UTC 2024, removed: null}, job origin:117
2024-12-18 06:57:58,717 DEBUG [o.a.c.f.j.i.AsyncJobManagerImpl] (Work-Job-Executor-44:ctx-45531ac1 job-117/job-118) (logid:d30252c8) Complete async job-118, jobStatus: FAILED, resultCode: 0, result: rO0ABXNyAC9jb20uY2xvdWQudXRpbHMuZXhjZXB0aW9uLkNsb3VkUnVudGltZUV4Y2VwdGlvblZNT3AAAAACAwABSQALY3NFcnJvckNvZGV4cgAaamF2YS5sYW5nLlJ1bnRpbWVFeGNlcHRpb26eXwZHCjSD5QIAAHhyABNqYXZhLmxhbmcuRXhjZXB0aW9u0P0fPho7HMQCAAB4cgATamF2YS5sYW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a.c.f.j.i.AsyncJobManagerImpl] (Work-Job-Executor-44:ctx-45531ac1 job-117/job-118) (logid:d30252c8) Publish async job-118 complete on message bus
2024-12-18 06:57:58,718 DEBUG [o.a.c.f.j.i.AsyncJobManagerImpl] (Work-Job-Executor-44:ctx-45531ac1 job-117/job-118) (logid:d30252c8) Wake up jobs related to job-118
2024-12-18 06:57:58,718 DEBUG [o.a.c.f.j.i.AsyncJobManagerImpl] (Work-Job-Executor-44:ctx-45531ac1 job-117/job-118) (logid:d30252c8) Update db status for job-118
2024-12-18 06:57:58,723 DEBUG [o.a.c.f.j.i.AsyncJobManagerImpl] (Work-Job-Executor-44:ctx-45531ac1 job-117/job-118) (logid:d30252c8) Wake up jobs joined with job-118 and disjoin all subjobs created from job- 118
2024-12-18 06:57:58,732 DEBUG [o.a.c.f.j.i.AsyncJobManagerImpl] (Work-Job-Executor-44:ctx-45531ac1 job-117/job-118) (logid:d30252c8) Done executing com.cloud.vm.VmWorkAttachVolume for job-118
2024-12-18 06:57:58,733 INFO  [o.a.c.f.j.i.AsyncJobMonitor] (Work-Job-Executor-44:ctx-45531ac1 job-117/job-118) (logid:d30252c8) Remove job-118 from job monitoring
2024-12-18 06:57:58,750 ERROR [c.c.a.ApiAsyncJobDispatcher] (API-Job-Executor-67:ctx-9a295591 job-117) (logid:d30252c8) Unexpected exception while executing org.apache.cloudstack.api.command.admin.volume.AttachVolumeCmdByAdmin
2024-12-18 06:57:58,753 DEBUG [o.a.c.f.j.i.AsyncJobManagerImpl] (API-Job-Executor-67:ctx-9a295591 job-117) (logid:d30252c8) Complete async job-117, jobStatus: FAILED, resultCode: 530, result: org.apache.cloudstack.api.response.ExceptionResponse/null/{"uuidList":[],"errorcode":"530","errortext":"Volume: test8 is in Uploaded. It should be in Ready or Allocated state"}
2024-12-18 06:57:58,754 DEBUG [o.a.c.f.j.i.AsyncJobManagerImpl] (API-Job-Executor-67:ctx-9a295591 job-117) (logid:d30252c8) Publish async job-117 complete on message bus
2024-12-18 06:57:58,754 DEBUG [o.a.c.f.j.i.AsyncJobManagerImpl] (API-Job-Executor-67:ctx-9a295591 job-117) (logid:d30252c8) Wake up jobs related to job-117
2024-12-18 06:57:58,754 DEBUG [o.a.c.f.j.i.AsyncJobManagerImpl] (API-Job-Executor-67:ctx-9a295591 job-117) (logid:d30252c8) Update db status for job-117
2024-12-18 06:57:58,755 DEBUG [o.a.c.f.j.i.AsyncJobManagerImpl] (API-Job-Executor-67:ctx-9a295591 job-117) (logid:d30252c8) Wake up jobs joined with job-117 and disjoin all subjobs created from job- 117
2024-12-18 06:57:58,759 DEBUG [o.a.c.f.j.i.AsyncJobManagerImpl] (API-Job-Executor-67:ctx-9a295591 job-117) (logid:d30252c8) Done executing org.apache.cloudstack.api.command.admin.volume.AttachVolumeCmdByAdmin for job-117
2024-12-18 06:57:58,759 INFO  [o.a.c.f.j.i.AsyncJobMonitor] (API-Job-Executor-67:ctx-9a295591 job-117) (logid:d30252c8) Remove job-117 from job monitoring

The workaround is the following steps

  1. Launch 2 Cloudstack instances (vm1 and vm2) with only root disk in the same admin account.
  2. Stop the instances (vm1 and vm2).
  3. Download the root disk of vm1 to you local desktop
  4. Upload the root disk of vm1 to the admin account
  5. Attach the uploaded root disk of vm 1 to vm 2( Make sure to attach it as device id 1) i.e basically as a data disk)
  6. Now the uploaded root disk of vm 1 is attached a data disk of vm2 and is in Ready state

Screenshot 2024-12-18 at 12 57 19 PM

  1. Now make sure the vm2 has 2 disks in ready state ( screenshot attached)
  2. Detach both the disks from the vm 2
  3. Attach the uploaded root disk of vm 1 as root disk(Make sure to attach it as device id 0)
  4. Start the vm 2

Expected Behaviour

Cloudstack should support attaching a volume which is in the uploaded state as root disk /data disk when there are no disks associated with the vm

Actual Behaviour

Cloudstack throws a error attaching a volume which is in the uploaded state as root disk /data disk when there are no disks associated with the vm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

2 participants