Title: Maintenance mode destination nullpointer with local storage data disk · Issue #9887 · apache/cloudstack · GitHub
Open Graph Title: Maintenance mode destination nullpointer with local storage data disk · Issue #9887 · apache/cloudstack
X Title: Maintenance mode destination nullpointer with local storage data disk · Issue #9887 · apache/cloudstack
Description: ISSUE TYPE Bug Report COMPONENT NAME Maintenance Mode CLOUDSTACK VERSION 4.19.1.2 CONFIGURATION host.maintenance.local.storage.strategy: Migration OS / ENVIRONMENT SUMMARY Nullpointer exception when setting a host in maintenance if the h...
Open Graph Description: ISSUE TYPE Bug Report COMPONENT NAME Maintenance Mode CLOUDSTACK VERSION 4.19.1.2 CONFIGURATION host.maintenance.local.storage.strategy: Migration OS / ENVIRONMENT SUMMARY Nullpointer exception whe...
X Description: ISSUE TYPE Bug Report COMPONENT NAME Maintenance Mode CLOUDSTACK VERSION 4.19.1.2 CONFIGURATION host.maintenance.local.storage.strategy: Migration OS / ENVIRONMENT SUMMARY Nullpointer exception whe...
Opengraph URL: https://github.com/apache/cloudstack/issues/9887
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Maintenance mode destination nullpointer with local storage data disk","articleBody":"\u003c!--\r\nVerify first that your issue/request is not already reported on GitHub.\r\nAlso test if the latest release and main branch are affected too.\r\nAlways add information AFTER of these HTML comments, but no need to delete the comments.\r\n--\u003e\r\n\r\n##### ISSUE TYPE\r\n\u003c!-- Pick one below and delete the rest --\u003e\r\n * Bug Report\r\n\r\n##### COMPONENT NAME\r\n\u003c!--\r\nCategorize the issue, e.g. API, VR, VPN, UI, etc.\r\n--\u003e\r\n~~~\r\nMaintenance Mode\r\n~~~\r\n\r\n##### CLOUDSTACK VERSION\r\n\u003c!--\r\nNew line separated list of affected versions, commit ID for issues on main branch.\r\n--\u003e\r\n\r\n~~~\r\n4.19.1.2\r\n~~~\r\n\r\n##### CONFIGURATION\r\n\u003c!--\r\nInformation about the configuration if relevant, e.g. basic network, advanced networking, etc. N/A otherwise\r\n--\u003e\r\n~~~\r\nhost.maintenance.local.storage.strategy: Migration\r\n~~~\r\n\r\n##### OS / ENVIRONMENT\r\n\u003c!--\r\nInformation about the environment if relevant, N/A otherwise\r\n--\u003e\r\n\r\n\r\n##### SUMMARY\r\n\u003c!-- Explain the problem/feature briefly --\u003e\r\nNullpointer exception when setting a host in maintenance if the host has a running vm with a local storage data disk.\r\n\r\nFound the bug while fixing another bug where the host going into maintenance is not avoided so maintenance for local storage vms can fail.\r\nDuring testing I did not find a path in the current version to reach the breaking code without a debugger attached.\r\n\r\nBug is caused by the deployment returning `null` causing a nullpointer in https://github.com/apache/cloudstack/blob/18fe4226cecc930ec0b39c43e5b63a48c17c2ad4/server/src/main/java/com/cloud/resource/ResourceManagerImpl.java#L1471\r\n\r\nDeployment returns null as the only suitable storage pool returned by `findSuitablePoolsForVolumes` in `server/src/main/java/com/cloud/deploy/DeploymentPlanningManagerImpl.java` for the data disk is the host the data disk is located on. (Only applies for data disk, for a local storage root disk all suitable storage pools are evaluated). With that host being avoided to prepare it for maintenance the deployment planner has no suitable hosts returning null.\r\n\r\nMigrating the vm using the ui does not cause issues.\r\n\r\n##### STEPS TO REPRODUCE\r\n\u003c!--\r\nFor bugs, show exactly how to reproduce the problem, using a minimal test-case. Use Screenshots if accurate.\r\n\r\nFor new features, show how the feature would be used.\r\n--\u003e\r\n* Create a vm with a local storage data disk.\r\n* Add breakpoint at the start of https://github.com/apache/cloudstack/blob/18fe4226cecc930ec0b39c43e5b63a48c17c2ad4/server/src/main/java/com/cloud/deploy/DeploymentPlanningManagerImpl.java#L300\r\n* Set host with the vm in maintenance\r\n* Add the host going into maintenance to the avoids `avoids.addHost();`\r\n* Continue running\r\n\r\n\u003c!-- Paste example playbooks or commands between quotes below --\u003e\r\n\r\n\r\n\u003c!-- You can also paste gist.github.com links for larger files --\u003e\r\n\r\n##### EXPECTED RESULTS\r\n\u003c!-- What did you expect to happen when running the steps above? --\u003e\r\nVM migrated and host going into maintenance\r\n\r\n##### ACTUAL RESULTS\r\n\u003c!-- What actually happened? --\u003e\r\n\r\n\u003c!-- Paste verbatim command output between quotes below --\u003e\r\n~~~\r\n2024-11-01 16:04:39,428 ERROR [c.c.a.ApiAsyncJobDispatcher] (API-Job-Executor-5:ctx-b739d4ae job-371) (logid:51494050) Unexpected exception while executing org.apache.cloudstack.api.command.\r\nadmin.host.PrepareForMaintenanceCmd\r\njava.lang.NullPointerException\r\n at com.cloud.resource.ResourceManagerImpl.migrateAwayVmWithVolumes(ResourceManagerImpl.java:1471)\r\n at com.cloud.resource.ResourceManagerImpl.doMaintain(ResourceManagerImpl.java:1403)\r\n at com.cloud.resource.ResourceManagerImpl.maintain(ResourceManagerImpl.java:1489)\r\n at com.cloud.resource.ResourceManagerImpl.maintain(ResourceManagerImpl.java:1543)\r\n at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\r\n at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n at java.base/java.lang.reflect.Method.invoke(Method.java:566)\r\n at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)\r\n at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)\r\n at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)\r\n at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97)\r\n at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)\r\n at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:215)\r\n at com.sun.proxy.$Proxy200.maintain(Unknown Source)\r\n at org.apache.cloudstack.api.command.admin.host.PrepareForMaintenanceCmd.execute(PrepareForMaintenanceCmd.java:101)\r\n at com.cloud.api.ApiDispatcher.dispatch(ApiDispatcher.java:172)\r\n at com.cloud.api.ApiAsyncJobDispatcher.runJob(ApiAsyncJobDispatcher.java:112)\r\n at org.apache.cloudstack.framework.jobs.impl.AsyncJobManagerImpl$5.runInContext(AsyncJobManagerImpl.java:654)\r\n at org.apache.cloudstack.managed.context.ManagedContextRunnable$1.run(ManagedContextRunnable.java:48)\r\n at org.apache.cloudstack.managed.context.impl.DefaultManagedContext$1.call(DefaultManagedContext.java:55)\r\n at org.apache.cloudstack.managed.context.impl.DefaultManagedContext.callWithContext(DefaultManagedContext.java:102)\r\n at org.apache.cloudstack.managed.context.impl.DefaultManagedContext.runWithContext(DefaultManagedContext.java:52)\r\n at org.apache.cloudstack.managed.context.ManagedContextRunnable.run(ManagedContextRunnable.java:45)\r\n at org.apache.cloudstack.framework.jobs.impl.AsyncJobManagerImpl$5.run(AsyncJobManagerImpl.java:602)\r\n at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)\r\n at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)\r\n at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)\r\n at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)\r\n at java.base/java.lang.Thread.run(Thread.java:829)\r\n\r\n~~~\r\n\r\n","author":{"url":"https://github.com/BartJM","@type":"Person","name":"BartJM"},"datePublished":"2024-11-04T16:32:31.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":9},"url":"https://github.com/9887/cloudstack/issues/9887"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:2a6e528c-6587-4c3c-b354-94695a446992 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DE90:71B10:D78957:12868C1:6A4DCD27 |
| html-safe-nonce | 390845d2c67d76fcd2da52aeebf509882f992291e7d8d0ce08722313515c7d81 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERTkwOjcxQjEwOkQ3ODk1NzoxMjg2OEMxOjZBNERDRDI3IiwidmlzaXRvcl9pZCI6IjY0NTY1MjI5NDIyNzIzNTk3MTkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | c3bf11c9ec750b3774c5843821c316d39b9f3fc7b8d53be1e1c7a95bfc044cf9 |
| hovercard-subject-tag | issue:2633282202 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/apache/cloudstack/9887/issue_layout |
| twitter:image | https://opengraph.githubassets.com/dcf00e7fc4d71282e9207b4bd8f4647f91c437eca63a8284ca77a0c8b92e3b34/apache/cloudstack/issues/9887 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/dcf00e7fc4d71282e9207b4bd8f4647f91c437eca63a8284ca77a0c8b92e3b34/apache/cloudstack/issues/9887 |
| og:image:alt | ISSUE TYPE Bug Report COMPONENT NAME Maintenance Mode CLOUDSTACK VERSION 4.19.1.2 CONFIGURATION host.maintenance.local.storage.strategy: Migration OS / ENVIRONMENT SUMMARY Nullpointer exception whe... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | BartJM |
| hostname | github.com |
| expected-hostname | github.com |
| None | 06b8a6144231bf3a234f1c2e9993861e07ce98a905912b114aa386c2d7e84b33 |
| turbo-cache-control | no-preview |
| go-import | github.com/apache/cloudstack git https://github.com/apache/cloudstack.git |
| octolytics-dimension-user_id | 47359 |
| octolytics-dimension-user_login | apache |
| octolytics-dimension-repository_id | 9759448 |
| octolytics-dimension-repository_nwo | apache/cloudstack |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 9759448 |
| octolytics-dimension-repository_network_root_nwo | apache/cloudstack |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 1d344bdb7547fe6bca17a59bb2b8aac3dc9532a0 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width