apache / cloudstack

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

unable create instance using .raw file and .qcow2 file from opennebula cloud #8301

Closed herdiansah571 closed 8 months ago

herdiansah571 commented 8 months ago
ISSUE TYPE
COMPONENT NAME
vm instance
CLOUDSTACK VERSION
4.18
CONFIGURATION
OS / ENVIRONMENT
SUMMARY
STEPS TO REPRODUCE
Hello,
currently I succesfully install apache cloudstack 4.18 version, right now  I need migrate some vm instance from opennebula using .qcow2 file or .raw file. And then I create template on cloudstack using .raw file that I take from opennebula, Then I create instance on cloudstack and the result " Unable to create a deployment for VM instance {"id":12,"instanceName":"i-2-12-VM","type":"User","uuid":"7cd5ef80-f318-47f2-8cfe-b9862af91570"}Scope=interface com.cloud.dc.DataCenter; id=1"

here is file of /var/log/cloudstack/management/management-server.log

2023-12-05 09:27:26,992 INFO  [c.c.v.VirtualMachineManagerImpl] (qtp1550261631-326:ctx-ec85c922 ctx-a3267000) (logid:fb15a3f6) allocating virtual machine from template:49145286-3781-4d35-bfd8-85587c723755 with hostname:i-2-12-VM and 1 networks
2023-12-05 09:27:26,999 DEBUG [c.c.v.VirtualMachineManagerImpl] (qtp1550261631-326:ctx-ec85c922 ctx-a3267000) (logid:fb15a3f6) Allocating entries for VM: VM instance {"id":12,"instanceName":"i-2-12-VM","type":"User","uuid":"7cd5ef80-f318-47f2-8cfe-b9862af91570"}
2023-12-05 09:27:27,004 DEBUG [c.c.v.VirtualMachineManagerImpl] (qtp1550261631-326:ctx-ec85c922 ctx-a3267000) (logid:fb15a3f6) Allocating nics for VM instance {"id":12,"instanceName":"i-2-12-VM","type":"User","uuid":"7cd5ef80-f318-47f2-8cfe-b9862af91570"}
2023-12-05 09:27:27,010 DEBUG [o.a.c.e.o.NetworkOrchestrator] (qtp1550261631-326:ctx-ec85c922 ctx-a3267000) (logid:fb15a3f6) Allocating nic for vm VM instance {"id":12,"instanceName":"i-2-12-VM","type":"User","uuid":"7cd5ef80-f318-47f2-8cfe-b9862af91570"} in network Network {"id": 204, "name": "local", "uuid": "4ae7a0cf-2fc0-449f-9519-54cb07a72d80", "networkofferingid": 13} with requested profile NicProfile {"broadcastUri":null,"iPv4Address":null,"id":0,"reservationId":null,"vmId":0}
2023-12-05 09:27:27,075 DEBUG [c.c.v.VirtualMachineManagerImpl] (qtp1550261631-326:ctx-ec85c922 ctx-a3267000) (logid:fb15a3f6) Allocating disks for VM instance {"id":12,"instanceName":"i-2-12-VM","type":"User","uuid":"7cd5ef80-f318-47f2-8cfe-b9862af91570"}
2023-12-05 09:27:27,081 INFO  [o.a.c.e.o.VolumeOrchestrator] (qtp1550261631-326:ctx-ec85c922 ctx-a3267000 ctx-c2bbb018) (logid:fb15a3f6) Adding disk object [ROOT-12] to VM [VM instance {"id":12,"instanceName":"i-2-12-VM","type":"User","uuid":"7cd5ef80-f318-47f2-8cfe-b9862af91570"}]
2023-12-05 09:27:27,157 DEBUG [c.c.v.VirtualMachineManagerImpl] (qtp1550261631-326:ctx-ec85c922 ctx-a3267000) (logid:fb15a3f6) Allocation completed for VM: VM instance {"id":12,"instanceName":"i-2-12-VM","type":"User","uuid":"7cd5ef80-f318-47f2-8cfe-b9862af91570"}
2023-12-05 09:27:27,158 DEBUG [c.c.v.UserVmManagerImpl] (qtp1550261631-326:ctx-ec85c922 ctx-a3267000) (logid:fb15a3f6) Successfully allocated DB entry for VM instance {"id":12,"instanceName":"i-2-12-VM","type":"User","uuid":"7cd5ef80-f318-47f2-8cfe-b9862af91570"}
2023-12-05 09:27:29,305 DEBUG [c.c.v.VirtualMachineManagerImpl] (Work-Job-Executor-7:ctx-a92eb148 job-81/job-82 ctx-1843b91f) (logid:1fa1090e) orchestrating VM start for 'i-2-12-VM' com.cloud.vm.VirtualMachineProfile$Param@b66cdd7d set to null
2023-12-05 09:27:29,324 DEBUG [c.c.c.CapacityManagerImpl] (Work-Job-Executor-7:ctx-a92eb148 job-81/job-82 ctx-1843b91f) (logid:1fa1090e) VM instance {"id":12,"instanceName":"i-2-12-VM","type":"User","uuid":"7cd5ef80-f318-47f2-8cfe-b9862af91570"} state transited from [Stopped] to [Starting] with event [StartRequested]. VM's original host: null, new host: null, host before state transition: null
2023-12-05 09:27:29,326 DEBUG [c.c.v.VirtualMachineManagerImpl] (Work-Job-Executor-7:ctx-a92eb148 job-81/job-82 ctx-1843b91f) (logid:1fa1090e) Successfully transitioned to start state for VM instance {"id":12,"instanceName":"i-2-12-VM","type":"User","uuid":"7cd5ef80-f318-47f2-8cfe-b9862af91570"} reservation id = 3c4601e9-0cfe-4564-97ba-311f765ad4ef
2023-12-05 09:27:29,479 DEBUG [c.c.v.VirtualMachineManagerImpl] (Work-Job-Executor-7:ctx-a92eb148 job-81/job-82 ctx-1843b91f) (logid:1fa1090e) Deployment found - Attempt #1 - P0=VM instance {"id":12,"instanceName":"i-2-12-VM","type":"User","uuid":"7cd5ef80-f318-47f2-8cfe-b9862af91570"}, P0=Dest[Zone(Id)-Pod(Id)-Cluster(Id)-Host(Id)-Storage(Volume(Id|Type-->Pool(Id))] : Dest[Zone(1)-Pod(1)-Cluster(1)-Host(4)-Storage(Volume(9|ROOT-->Pool(1))]
2023-12-05 09:27:29,504 DEBUG [c.c.c.CapacityManagerImpl] (Work-Job-Executor-7:ctx-a92eb148 job-81/job-82 ctx-1843b91f) (logid:1fa1090e) VM instance {"id":12,"instanceName":"i-2-12-VM","type":"User","uuid":"7cd5ef80-f318-47f2-8cfe-b9862af91570"} state transited from [Starting] to [Starting] with event [OperationRetry]. VM's original host: null, new host: Host {"id":4,"name":"kvm-2","type":"Routing","uuid":"a99b2b77-2a7f-4cb6-9d76-ff20ba7757bc"}, host before state transition: null
2023-12-05 09:27:32,986 DEBUG [c.c.a.t.Request] (Work-Job-Executor-7:ctx-a92eb148 job-81/job-82 ctx-1843b91f) (logid:1fa1090e) Seq 4-9141462818631974929: Sending  { Cmd , MgmtId: 48674822359776, via: 4(kvm-2), Ver: v1, Flags: 100111, [{"org.apache.cloudstack.storage.command.CopyCommand":{"srcTO":{"org.apache.cloudstack.storage.to.TemplateObjectTO":{"path":"7e810764-1485-4f45-9ddd-49f8026cb6ad","origUrl":"http://192.168.200.91:8090/download/templates/backup-bgrlwso-01-localdomain-2023-11-07.img","uuid":"49145286-3781-4d35-bfd8-85587c723755","id":"217","format":"RAW","accountId":"2","hvm":"true","displayText":"webkerth","imageDataStore":{"org.apache.cloudstack.storage.to.PrimaryDataStoreTO":{"uuid":"a7f4d456-26b6-3fae-911f-d8205f70bd21","name":"Primary","id":"1","poolType":"NetworkFilesystem","host":"30.30.30.2","path":"/export/primary","port":"2049","url":"NetworkFilesystem://30.30.30.2/export/primary/?ROLE=Primary&STOREUUID=a7f4d456-26b6-3fae-911f-d8205f70bd21","isManaged":"false"}},"name":"217-2-1920d265-61c2-39db-a2d9-d3968e93c7dd","size":"(200.00 GB) 214748364800","hypervisorType":"KVM","bootable":"false","uniqueName":"217-2-1920d265-61c2-39db-a2d9-d3968e93c7dd","directDownload":"true","deployAsIs":"false"}},"destTO":{"org.apache.cloudstack.storage.to.VolumeObjectTO":{"uuid":"f9d1f02b-6bcc-495c-80f7-2bebc2dba57b","volumeType":"ROOT","dataStore":{"org.apache.cloudstack.storage.to.PrimaryDataStoreTO":{"uuid":"a7f4d456-26b6-3fae-911f-d8205f70bd21","name":"Primary","id":"1","poolType":"NetworkFilesystem","host":"30.30.30.2","path":"/export/primary","port":"2049","url":"NetworkFilesystem://30.30.30.2/export/primary/?ROLE=Primary&STOREUUID=a7f4d456-26b6-3fae-911f-d8205f70bd21","isManaged":"false"}},"name":"ROOT-12","size":"(250.00 GB) 268435456000","volumeId":"9","vmName":"i-2-12-VM","accountId":"2","format":"QCOW2","provisioningType":"THIN","poolId":"1","id":"9","deviceId":"0","hypervisorType":"KVM","directDownload":"false","deployAsIs":"false"}},"executeInSequence":"true","options":{},"options2":{},"wait":"0","bypassHostMaintenance":"false"}}] }
2023-12-05 09:27:33,178 DEBUG [c.c.v.VirtualMachineManagerImpl] (Work-Job-Executor-7:ctx-a92eb148 job-81/job-82 ctx-1843b91f) (logid:1fa1090e) Cleaning up resources for the vm VM instance {"id":12,"instanceName":"i-2-12-VM","type":"User","uuid":"7cd5ef80-f318-47f2-8cfe-b9862af91570"} in Starting state
2023-12-05 09:27:33,202 DEBUG [c.c.v.VirtualMachineManagerImpl] (Work-Job-Executor-7:ctx-a92eb148 job-81/job-82 ctx-1843b91f) (logid:1fa1090e) VM instance {"id":12,"instanceName":"i-2-12-VM","type":"User","uuid":"7cd5ef80-f318-47f2-8cfe-b9862af91570"} is a [User], returning null for control Nic IP.
2023-12-05 09:27:33,216 DEBUG [c.c.a.t.Request] (Work-Job-Executor-7:ctx-a92eb148 job-81/job-82 ctx-1843b91f) (logid:1fa1090e) Seq 4-9141462818631974930: Sending  { Cmd , MgmtId: 48674822359776, via: 4(kvm-2), Ver: v1, Flags: 100011, [{"com.cloud.agent.api.StopCommand":{"isProxy":"false","checkBeforeCleanup":"false","forceStop":"false","vlanToPersistenceMap":{"854":"true"},"volumesToDisconnect":[],"vmName":"i-2-12-VM","executeInSequence":"false","wait":"0","bypassHostMaintenance":"false"}}] }
2023-12-05 09:27:33,537 DEBUG [c.c.v.VirtualMachineManagerImpl] (Work-Job-Executor-7:ctx-a92eb148 job-81/job-82 ctx-1843b91f) (logid:1fa1090e) Successfully released network resources for the VM VM instance {"id":12,"instanceName":"i-2-12-VM","type":"User","uuid":"7cd5ef80-f318-47f2-8cfe-b9862af91570"} in Starting state
2023-12-05 09:27:33,553 DEBUG [c.c.v.VirtualMachineManagerImpl] (Work-Job-Executor-7:ctx-a92eb148 job-81/job-82 ctx-1843b91f) (logid:1fa1090e) Successfully released storage resources for the VM VM instance {"id":12,"instanceName":"i-2-12-VM","type":"User","uuid":"7cd5ef80-f318-47f2-8cfe-b9862af91570"} in Starting state
2023-12-05 09:27:33,553 DEBUG [c.c.v.VirtualMachineManagerImpl] (Work-Job-Executor-7:ctx-a92eb148 job-81/job-82 ctx-1843b91f) (logid:1fa1090e) Successfully cleaned up resources for the VM VM instance {"id":12,"instanceName":"i-2-12-VM","type":"User","uuid":"7cd5ef80-f318-47f2-8cfe-b9862af91570"} in Starting state
2023-12-05 09:27:33,615 DEBUG [c.c.c.CapacityManagerImpl] (Work-Job-Executor-7:ctx-a92eb148 job-81/job-82 ctx-1843b91f) (logid:1fa1090e) VM instance {"id":12,"instanceName":"i-2-12-VM","type":"User","uuid":"7cd5ef80-f318-47f2-8cfe-b9862af91570"} state transited from [Starting] to [Stopped] with event [OperationFailed]. VM's original host: null, new host: null, host before state transition: Host {"id":4,"name":"kvm-2","type":"Routing","uuid":"a99b2b77-2a7f-4cb6-9d76-ff20ba7757bc"}
2023-12-05 09:27:33,646 ERROR [c.c.v.VmWorkJobHandlerProxy] (Work-Job-Executor-7:ctx-a92eb148 job-81/job-82 ctx-1843b91f) (logid:1fa1090e) Invocation exception, caused by: com.cloud.exception.InsufficientServerCapacityException: Unable to create a deployment for VM instance {"id":12,"instanceName":"i-2-12-VM","type":"User","uuid":"7cd5ef80-f318-47f2-8cfe-b9862af91570"}Scope=interface com.cloud.dc.DataCenter; id=1
2023-12-05 09:27:33,646 INFO  [c.c.v.VmWorkJobHandlerProxy] (Work-Job-Executor-7:ctx-a92eb148 job-81/job-82 ctx-1843b91f) (logid:1fa1090e) Rethrow exception com.cloud.exception.InsufficientServerCapacityException: Unable to create a deployment for VM instance {"id":12,"instanceName":"i-2-12-VM","type":"User","uuid":"7cd5ef80-f318-47f2-8cfe-b9862af91570"}Scope=interface com.cloud.dc.DataCenter; id=1
com.cloud.exception.InsufficientServerCapacityException: Unable to create a deployment for VM instance {"id":12,"instanceName":"i-2-12-VM","type":"User","uuid":"7cd5ef80-f318-47f2-8cfe-b9862af91570"}Scope=interface com.cloud.dc.DataCenter; id=1
2023-12-05 09:27:33,697 DEBUG [c.c.v.UserVmManagerImpl] (API-Job-Executor-4:ctx-05339c4d job-81 ctx-c61aff62) (logid:1fa1090e) Destroying vm VM instance {"id":12,"instanceName":"i-2-12-VM","type":"User","uuid":"7cd5ef80-f318-47f2-8cfe-b9862af91570"} as it failed to create on Host with Id:4
2023-12-05 09:27:33,710 DEBUG [c.c.c.CapacityManagerImpl] (API-Job-Executor-4:ctx-05339c4d job-81 ctx-c61aff62) (logid:1fa1090e) VM instance {"id":12,"instanceName":"i-2-12-VM","type":"User","uuid":"7cd5ef80-f318-47f2-8cfe-b9862af91570"} state transited from [Stopped] to [Error] with event [OperationFailedToError]. VM's original host: null, new host: null, host before state transition: null
com.cloud.utils.exception.CloudRuntimeException: Unable to start a VM [7cd5ef80-f318-47f2-8cfe-b9862af91570] due to [Unable to create a deployment for VM instance {"id":12,"instanceName":"i-2-12-VM","type":"User","uuid":"7cd5ef80-f318-47f2-8cfe-b9862af91570"}].
Caused by: com.cloud.exception.InsufficientServerCapacityException: Unable to create a deployment for VM instance {"id":12,"instanceName":"i-2-12-VM","type":"User","uuid":"7cd5ef80-f318-47f2-8cfe-b9862af91570"}Scope=interface com.cloud.dc.DataCenter; id=1
2023-12-05 09:27:33,791 DEBUG [o.a.c.f.j.i.AsyncJobManagerImpl] (API-Job-Executor-4:ctx-05339c4d job-81) (logid:1fa1090e) Complete async job-81, jobStatus: FAILED, resultCode: 530, result: org.apache.cloudstack.api.response.ExceptionResponse/null/{"uuidList":[],"errorcode":"530","errortext":"Unable to start a VM [7cd5ef80-f318-47f2-8cfe-b9862af91570] due to [Unable to create a deployment for VM instance {"id":12,"instanceName":"i-2-12-VM","type":"User","uuid":"7cd5ef80-f318-47f2-8cfe-b9862af91570"}]."}

Anyone here can help me ????
Please help me....
Thanks!!!
EXPECTED RESULTS
ACTUAL RESULTS
NuxRo commented 8 months ago

Hello,

Usually when importing into Cloudstack/kvm you want the file to be formatted qcow2 and then bzipped, ie:

qemu-img convert -p file.raw -O qcow2 file.qcow2
bzip2 -v file.qcow2

Then register the resulting compressed file as a template in Cloudstack.

However, going through this (incomplete) log I get the feeling you have another problem there. If you deploy from a known good template does it work?

herdiansah571 commented 8 months ago

Hello @NuxRo,

how do you usually create template on cloudstack ? via command line or via gui web dashboard ? can you share step by step you usually create template on cloudstack ?

I usually register template via gui web dashboard apache cloudstack, If I deploy instance from template that I get from bellow url its work :

https://cloud-images.ubuntu.com/releases/22.04/release/ubuntu-22.04-server-cloudimg-amd64.img https://cloud-images.ubuntu.com/releases/focal/release/ubuntu-20.04-server-cloudimg-amd64.img https://cloud.debian.org/images/cloud/bookworm/latest/debian-12-genericcloud-amd64.qcow2 https://repo.almalinux.org/almalinux/9/cloud/x86_64/images/AlmaLinux-9-GenericCloud-latest.x86_64.qcow2 https://download.opensuse.org/distribution/leap/15.5/appliances/openSUSE-Leap-15.5-Minimal-VM.x86_64-Cloud.qcow2

But right now I need import our VMs .qcow2 file or .img file from opennebula cloud to apache cloudstack. I register that .qcow2 file or .img file into apache cloudstack, when I create instance using that template the result is "Unable to create a deployment for VM instance"

Please help me... Thanks

NuxRo commented 8 months ago

Hello,

As I said, you should be converting your raw files to qcow2.bz2, else you can't register them in Cloudstack as templates. Then you can deploy from them. I gave above an example command line how to do that.

herdiansah571 commented 8 months ago

Hello @NuxRo

Currently I succesfully import our VMs .qcow2 file or .img file from opennebula cloud to apache cloudstack following the tutorial you provided. thank you for helping me....

DaanHoogland commented 8 months ago

thanks for the feedback @herdiansah571 , closing this issue, please reopen or open a new one if you feel this is wrong.