Skip to content

Commit fb29608

Browse files
authored
consider last host only for root-admin (#7597)
1 parent 4ef7ebb commit fb29608

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

api/src/main/java/org/apache/cloudstack/api/command/user/vm/StartVMCmd.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ public class StartVMCmd extends BaseAsyncCmd implements UserCmd {
8686
type = CommandType.BOOLEAN,
8787
description = "True by default, CloudStack will firstly try to start the VM on the last host where it run on before stopping, if destination host is not specified. " +
8888
"If false, CloudStack will not consider the last host and start the VM by normal process.",
89-
since = "4.18.0")
89+
since = "4.18.0",
90+
authorized = {RoleType.Admin})
9091
private Boolean considerLastHost;
9192

9293
@Parameter(name = ApiConstants.DEPLOYMENT_PLANNER, type = CommandType.STRING, description = "Deployment planner to use for vm allocation. Available to ROOT admin only", since = "4.4", authorized = { RoleType.Admin })

ui/src/views/compute/StartVirtualMachine.vue

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,13 @@
8888
</a-select-option>
8989
</a-select>
9090
</a-form-item>
91+
92+
<a-form-item name="considerlasthost" ref="considerlasthost">
93+
<template #label>
94+
<tooltip-label :title="$t('label.considerlasthost')" :tooltip="apiParams.considerlasthost.description"/>
95+
</template>
96+
<a-switch v-model:checked="form.considerlasthost" />
97+
</a-form-item>
9198
</div>
9299

93100
<a-form-item name="bootintosetup" ref="bootintosetup" v-if="resource.hypervisor === 'VMware'">
@@ -97,13 +104,6 @@
97104
<a-switch v-model:checked="form.bootintosetup" />
98105
</a-form-item>
99106

100-
<a-form-item name="considerlasthost" ref="considerlasthost">
101-
<template #label>
102-
<tooltip-label :title="$t('label.considerlasthost')" :tooltip="apiParams.considerlasthost.description"/>
103-
</template>
104-
<a-switch v-model:checked="form.considerlasthost" />
105-
</a-form-item>
106-
107107
<div :span="24" class="action-button">
108108
<a-button @click="closeAction">{{ $t('label.cancel') }}</a-button>
109109
<a-button :loading="loading" ref="submit" type="primary" @click="handleSubmit">{{ $t('label.ok') }}</a-button>

0 commit comments

Comments
 (0)