shwstppr edited a comment on issue #3939:
URL: https://github.com/apache/cloudstack/issues/3939#issuecomment-825494795
@Spaceman1984 For user VMs (on KVM; ACS 4.15), deployment fail when offering
with local storage is used and there are no available, enabled local storage
pools,
```
(localcloud) SBCM5> > list storagepools filter=id,name,scope,state,path
{
"count": 4,
"storagepool": [
{
"id": "1a5f7587-1b80-4d08-92b8-bd8cc3ed971d",
"name": "pr4710-t330-kvm-centos7-kvm1-local-1a5f7587",
"path": "/var/lib/libvirt/images",
"scope": "HOST",
"state": "Disabled"
},
{
"id": "fb0e3692-1dfd-45ac-94ca-0c5acb354622",
"name": "pr4710-t330-kvm-centos7-kvm2-local-fb0e3692",
"path": "/var/lib/libvirt/images",
"scope": "HOST",
"state": "Disabled"
},
{
"id": "402d65b4-07f0-38cd-82ec-d1f97b221c9e",
"name": "pr4710-t330-kvm-centos7-kvm-pri2",
"path":
"/acs/primary/pr4710-t330-kvm-centos7/pr4710-t330-kvm-centos7-kvm-pri2",
"scope": "CLUSTER",
"state": "Up"
},
{
"id": "2f8c15f5-6555-398e-beb7-0f5da9e8fe40",
"name": "pr4710-t330-kvm-centos7-kvm-pri1",
"path":
"/acs/primary/pr4710-t330-kvm-centos7/pr4710-t330-kvm-centos7-kvm-pri1",
"scope": "CLUSTER",
"state": "Up"
}
]
}
(localcloud) SBCM5> > list serviceofferings
id=81bd3662-bb19-492b-9248-b182a241874a
{
"count": 1,
"serviceoffering": [
{
"cacheMode": "none",
"cpunumber": 1,
"cpuspeed": 1000,
"created": "2021-04-23T08:20:28+0000",
"defaultuse": false,
"displaytext": "localstorageoffering",
"id": "81bd3662-bb19-492b-9248-b182a241874a",
"iscustomized": false,
"issystem": false,
"isvolatile": false,
"limitcpuuse": false,
"memory": 1024,
"name": "localstorageoffering",
"offerha": false,
"provisioningtype": "thin",
"rootdisksize": 0,
"storagetype": "local"
}
]
}
(localcloud) SBCM5> > deploy virtualmachine name=test1
zoneid=e261ed1b-22e4-44b3-a6ce-79b8b9c0ffa4
templateid=b83cc175-9329-11eb-b75b-1e0085000203
serviceofferingid=81bd3662-bb19-492b-9248-b182a241874a
{
"accountid": "cd516a56-9329-11eb-b75b-1e0085000203",
"cmd": "org.apache.cloudstack.api.command.admin.vm.DeployVMCmdByAdmin",
"completed": "2021-04-23T08:25:33+0000",
"created": "2021-04-23T08:25:33+0000",
"jobid": "a02192a4-20d2-43f9-b645-d29baf400623",
"jobinstanceid": "84725c21-4b0e-4139-a650-bbcf29d71fd2",
"jobinstancetype": "VirtualMachine",
"jobprocstatus": 0,
"jobresult": {
"errorcode": 533,
"errortext": "Unable to create a deployment for VM[User|i-2-27-VM]"
},
"jobresultcode": 530,
"jobresulttype": "object",
"jobstatus": 2,
"userid": "cd52af64-9329-11eb-b75b-1e0085000203"
}
🙈 Error: async API failed for job a02192a4-20d2-43f9-b645-d29baf400623
```
MS logs giving exception,
```
2021-04-23 08:25:33,642 DEBUG [o.a.c.s.a.LocalStoragePoolAllocator]
(API-Job-Executor-2:ctx-7984b076 job-208 ctx-57e803cb) (logid:a02192a4)
LocalStoragePoolAllocator trying to find storage pool to fit the vm
2021-04-23 08:25:33,643 DEBUG [o.a.c.s.a.LocalStoragePoolAllocator]
(API-Job-Executor-2:ctx-7984b076 job-208 ctx-57e803cb) (logid:a02192a4)
LocalStoragePoolAllocator returning 0 suitable storage pools
2021-04-23 08:25:33,643 DEBUG [o.a.c.s.a.ClusterScopeStoragePoolAllocator]
(API-Job-Executor-2:ctx-7984b076 job-208 ctx-57e803cb) (logid:a02192a4)
ClusterScopeStoragePoolAllocator looking for storage pool
2021-04-23 08:25:33,643 DEBUG [o.a.c.s.a.ZoneWideStoragePoolAllocator]
(API-Job-Executor-2:ctx-7984b076 job-208 ctx-57e803cb) (logid:a02192a4)
ZoneWideStoragePoolAllocator to find storage pool
2021-04-23 08:25:33,643 DEBUG [c.c.d.DeploymentPlanningManagerImpl]
(API-Job-Executor-2:ctx-7984b076 job-208 ctx-57e803cb) (logid:a02192a4) No
suitable pools found for volume: Vol[27|vm=27|ROOT] under cluster: 1
2021-04-23 08:25:33,643 DEBUG [c.c.d.DeploymentPlanningManagerImpl]
(API-Job-Executor-2:ctx-7984b076 job-208 ctx-57e803cb) (logid:a02192a4) No
suitable pools found
2021-04-23 08:25:33,643 DEBUG [c.c.d.DeploymentPlanningManagerImpl]
(API-Job-Executor-2:ctx-7984b076 job-208 ctx-57e803cb) (logid:a02192a4) No
suitable storagePools found under this Cluster: 1
2021-04-23 08:25:33,644 DEBUG [c.c.d.DeploymentPlanningManagerImpl]
(API-Job-Executor-2:ctx-7984b076 job-208 ctx-57e803cb) (logid:a02192a4) Could
not find suitable Deployment Destination for this VM under any clusters,
returning.
2021-04-23 08:25:33,645 DEBUG [c.c.d.FirstFitPlanner]
(API-Job-Executor-2:ctx-7984b076 job-208 ctx-57e803cb) (logid:a02192a4)
Searching all possible resources under this Zone: 1
2021-04-23 08:25:33,645 DEBUG [c.c.d.FirstFitPlanner]
(API-Job-Executor-2:ctx-7984b076 job-208 ctx-57e803cb) (logid:a02192a4) Listing
clusters in order of aggregate capacity, that have (at least one host with)
enough CPU and RAM capacity under this Zone: 1
2021-04-23 08:25:33,646 DEBUG [c.c.d.FirstFitPlanner]
(API-Job-Executor-2:ctx-7984b076 job-208 ctx-57e803cb) (logid:a02192a4)
Removing from the clusterId list these clusters from avoid set: [1]
2021-04-23 08:25:33,647 DEBUG [c.c.d.FirstFitPlanner]
(API-Job-Executor-2:ctx-7984b076 job-208 ctx-57e803cb) (logid:a02192a4) No
clusters found after removing disabled clusters and clusters in avoid list,
returning.
2021-04-23 08:25:33,648 DEBUG [c.c.v.UserVmManagerImpl]
(API-Job-Executor-2:ctx-7984b076 job-208 ctx-57e803cb) (logid:a02192a4)
Destroying vm VM[User|i-2-27-VM] as it failed to create on Host with Id:null
2021-04-23 08:25:33,652 DEBUG [c.c.c.CapacityManagerImpl]
(API-Job-Executor-2:ctx-7984b076 job-208 ctx-57e803cb) (logid:a02192a4) VM
state transitted from :Stopped to Error with event: OperationFailedToErrorvm's
original host id: null new host id: null host id before state transition: null
2021-04-23 08:25:33,662 DEBUG [c.c.r.ResourceLimitManagerImpl]
(API-Job-Executor-2:ctx-7984b076 job-208 ctx-57e803cb) (logid:a02192a4)
Updating resource Type = volume count for Account = 2 Operation = decreasing
Amount = 1
2021-04-23 08:25:33,666 DEBUG [c.c.r.ResourceLimitManagerImpl]
(API-Job-Executor-2:ctx-7984b076 job-208 ctx-57e803cb) (logid:a02192a4)
Updating resource Type = primary_storage count for Account = 2 Operation =
decreasing Amount = (8.00 GB) 8589934592
2021-04-23 08:25:33,673 WARN [c.c.a.AlertManagerImpl]
(API-Job-Executor-2:ctx-7984b076 job-208 ctx-57e803cb) (logid:a02192a4)
AlertType:: 8 | dataCenterId:: 1 | podId:: null | clusterId:: null | message::
Failed to deploy Vm with Id: 27, on Host with Id: null
2021-04-23 08:25:33,677 DEBUG [c.c.r.ResourceLimitManagerImpl]
(API-Job-Executor-2:ctx-7984b076 job-208 ctx-57e803cb) (logid:a02192a4)
Updating resource Type = user_vm count for Account = 2 Operation = decreasing
Amount = 1
2021-04-23 08:25:33,681 DEBUG [c.c.r.ResourceLimitManagerImpl]
(API-Job-Executor-2:ctx-7984b076 job-208 ctx-57e803cb) (logid:a02192a4)
Updating resource Type = cpu count for Account = 2 Operation = decreasing
Amount = 1
2021-04-23 08:25:33,684 DEBUG [c.c.r.ResourceLimitManagerImpl]
(API-Job-Executor-2:ctx-7984b076 job-208 ctx-57e803cb) (logid:a02192a4)
Updating resource Type = memory count for Account = 2 Operation = decreasing
Amount = 1024
2021-04-23 08:25:33,690 INFO [o.a.c.a.c.u.v.DeployVMCmd]
(API-Job-Executor-2:ctx-7984b076 job-208 ctx-57e803cb) (logid:a02192a4)
com.cloud.exception.InsufficientServerCapacityException: Unable to create a
deployment for VM[User|i-2-27-VM]Scope=interface com.cloud.dc.DataCenter; id=1
2021-04-23 08:25:33,692 INFO [o.a.c.a.c.u.v.DeployVMCmd]
(API-Job-Executor-2:ctx-7984b076 job-208 ctx-57e803cb) (logid:a02192a4) Unable
to create a deployment for VM[User|i-2-27-VM]
com.cloud.exception.InsufficientServerCapacityException: Unable to create a
deployment for VM[User|i-2-27-VM]Scope=interface com.cloud.dc.DataCenter; id=1
at
org.apache.cloudstack.engine.cloud.entity.api.VMEntityManagerImpl.reserveVirtualMachine(VMEntityManagerImpl.java:225)
at
org.apache.cloudstack.engine.cloud.entity.api.VirtualMachineEntityImpl.reserve(VirtualMachineEntityImpl.java:202)
at
com.cloud.vm.UserVmManagerImpl.startVirtualMachine(UserVmManagerImpl.java:4913)
at
com.cloud.vm.UserVmManagerImpl.startVirtualMachine(UserVmManagerImpl.java:4450)
at
com.cloud.vm.UserVmManagerImpl.startVirtualMachine(UserVmManagerImpl.java:4439)
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)
```
Considering this I would say VRs should follow the same behaviour. If we
have any concerns about behaviour change wrt previous ACS versions maybe we can
introduce a global config that can govern this deployment behaviour.
Thoughts @rhtyd @borisroman @vladimirpetrov @andrijapanicsb @weizhouapache
@GabrielBrascher @DaanHoogland ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]