Skip to content

Commit

Permalink
feat(xo-web): add toggle for viridian flag (#6631)
Browse files Browse the repository at this point in the history
Fixes #6572
  • Loading branch information
fbeauchamp committed Jan 19, 2023
1 parent 7174c1e commit ec00728
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 0 deletions.
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

0 comments on commit ec00728

Please sign in to comment.