cloudstack
cloudstack copied to clipboard
Fix VGPU available devices listing
Description
This PR fixes the VGPU deployment issue on a SQL statement:
2024-08-22T19:27:18,113 ERROR [c.c.g.d.HostGpuGroupsDaoImpl] (API-Job-Executor-25:[ctx-3747d8e0, job-111, ctx-4f10d82e, FirstFitRoutingAllocator]) (logid:e72eacab) DB Exception on: com.mysql.cj.jdbc.ClientPreparedStatement: SELECT host_gpu_groups.id, host_gpu_groups.group_name, host_gpu_groups.host_id FROM host_gpu_groups INNER JOIN vgpu_types groupId ON host_gpu_groups.id=groupId.gpu_group_id WHERE host_gpu_groups.host_id = 4 AND host_gpu_groups.group_name = x'47726f7570206f66204e564944494120436f72706f726174696f6e204756313030474c205b5445534c4120563130305d2047505573' AND (groupId.vgpu_type = x'706173737468726f756768' AND groupId.remaining_capacity > 0 ) ORDER BY vgpu_types.remaining_capacity DESC java.sql.SQLSyntaxErrorException: Unknown column 'vgpu_types.remaining_capacity' in 'order clause'
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:121)
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:916)
at com.mysql.cj.jdbc.ClientPreparedStatement.executeQuery(ClientPreparedStatement.java:972)
at org.apache.commons.dbcp2.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:122)
at org.apache.commons.dbcp2.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:122)
Fixes: #9483
Types of changes
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] New feature (non-breaking change which adds functionality)
- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] Enhancement (improves an existing feature and functionality)
- [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
- [ ] build/CI
- [ ] test (unit or integration test code)
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
- [ ] Major
- [ ] Minor
Bug Severity
- [ ] BLOCKER
- [ ] Critical
- [ ] Major
- [ ] Minor
- [ ] Trivial
Screenshots (if appropriate):
How Has This Been Tested?
Previously I was able to hit the SQL issue on deployment even on non GPU enabled hosts After the fix, the error is passed and hit no capacity exception (valid in my environment)