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

feat(xo-web): add toggle for viridian flag #6631

Merged
merged 4 commits into from
Jan 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- [REST API] Expose `residentVms` property on hosts objects
- [VM/Advanced] Clarify *Windows Update* label [#6628](https://github.com/vatesfr/xen-orchestra/issues/6628) (PR [#6632](https://github.com/vatesfr/xen-orchestra/pull/6632))
- [REST API] Add support to destroy VMs and VDIs
- [VM/Advanced] Add configuration flag for *Viridian* platform [#6572](https://github.com/vatesfr/xen-orchestra/issues/6572) (PR [#6631](https://github.com/vatesfr/xen-orchestra/pull/6631))

### Bug fixes

Expand Down
2 changes: 2 additions & 0 deletions packages/xo-server/src/api/vm.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -734,6 +734,8 @@ set.params = {

virtualizationMode: { type: 'string', optional: true },

viridian: { type: 'boolean', optional: true },

blockedOperations: { type: 'object', optional: true, properties: { '*': { type: ['boolean', 'null', 'string'] } } },

suspendSr: { type: ['string', 'null'], optional: true },
Expand Down
1 change: 1 addition & 0 deletions packages/xo-server/src/xapi-object-to-xo.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,7 @@ const TRANSFORMS = {
}
})(),
expNestedHvm: obj.platform['exp-nested-hvm'] === 'true',
viridian: obj.platform.viridian === 'true',
mainIpAddress: extractIpFromVmNetworks(guestMetrics?.networks),
high_availability: obj.ha_restart_priority,

Expand Down
3 changes: 3 additions & 0 deletions packages/xo-server/src/xapi/mixins/vm.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,9 @@ export default {
return vm.update_platform('videoram', String(videoram))
},
},
viridian: {
set: (viridian, vm) => vm.update_platform('viridian', viridian ? 'true' : null),
},

startDelay: {
get: vm => +vm.start_delay,
Expand Down
1 change: 1 addition & 0 deletions packages/xo-web/src/common/intl/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -1328,6 +1328,7 @@ const messages = {
resourceSet: 'Resource set',
resourceSetNone: 'None',
suspendSr: 'Suspend SR',
viridian: 'Viridian',
vmCpuLimitsLabel: 'CPU limits',
vmCpuTopology: 'Topology',
vmChooseCoresPerSocket: 'Default behavior',
Expand Down
6 changes: 6 additions & 0 deletions packages/xo-web/src/xo-app/vm/tab-advanced.js
Original file line number Diff line number Diff line change
Expand Up @@ -827,6 +827,12 @@ export default class TabAdvanced extends Component {
<SelectSuspendSr vm={vm} />
</td>
</tr>
<tr>
<th>{_('viridian')}</th>
<td>
<Toggle value={vm.viridian} onChange={value => editVm(vm, { viridian: value })} />
</td>
</tr>
</tbody>
</table>
<br />
Expand Down