This is an automated email from the ASF dual-hosted git repository.

dahn pushed a commit to branch 4.18
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/4.18 by this push:
     new fb29608f610 consider last host only for root-admin (#7597)
fb29608f610 is described below

commit fb29608f61012f2529056e7ad9f15572ec944c2b
Author: dahn <[email protected]>
AuthorDate: Wed Jun 14 09:35:55 2023 +0200

    consider last host only for root-admin (#7597)
---
 .../apache/cloudstack/api/command/user/vm/StartVMCmd.java  |  3 ++-
 ui/src/views/compute/StartVirtualMachine.vue               | 14 +++++++-------
 2 files changed, 9 insertions(+), 8 deletions(-)

diff --git 
a/api/src/main/java/org/apache/cloudstack/api/command/user/vm/StartVMCmd.java 
b/api/src/main/java/org/apache/cloudstack/api/command/user/vm/StartVMCmd.java
index 033a338fa7d..10c50dc380b 100644
--- 
a/api/src/main/java/org/apache/cloudstack/api/command/user/vm/StartVMCmd.java
+++ 
b/api/src/main/java/org/apache/cloudstack/api/command/user/vm/StartVMCmd.java
@@ -86,7 +86,8 @@ public class StartVMCmd extends BaseAsyncCmd implements 
UserCmd {
             type = CommandType.BOOLEAN,
             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. " +
                     "If false, CloudStack will not consider the last host and 
start the VM by normal process.",
-            since = "4.18.0")
+            since = "4.18.0",
+            authorized = {RoleType.Admin})
     private Boolean considerLastHost;
 
     @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 })
diff --git a/ui/src/views/compute/StartVirtualMachine.vue 
b/ui/src/views/compute/StartVirtualMachine.vue
index 828a4a31f59..4440153d150 100644
--- a/ui/src/views/compute/StartVirtualMachine.vue
+++ b/ui/src/views/compute/StartVirtualMachine.vue
@@ -88,6 +88,13 @@
               </a-select-option>
             </a-select>
           </a-form-item>
+
+          <a-form-item name="considerlasthost" ref="considerlasthost">
+            <template #label>
+              <tooltip-label :title="$t('label.considerlasthost')" 
:tooltip="apiParams.considerlasthost.description"/>
+            </template>
+            <a-switch v-model:checked="form.considerlasthost" />
+          </a-form-item>
         </div>
 
         <a-form-item name="bootintosetup" ref="bootintosetup" 
v-if="resource.hypervisor === 'VMware'">
@@ -97,13 +104,6 @@
           <a-switch v-model:checked="form.bootintosetup" />
         </a-form-item>
 
-        <a-form-item name="considerlasthost" ref="considerlasthost">
-          <template #label>
-            <tooltip-label :title="$t('label.considerlasthost')" 
:tooltip="apiParams.considerlasthost.description"/>
-          </template>
-          <a-switch v-model:checked="form.considerlasthost" />
-        </a-form-item>
-
         <div :span="24" class="action-button">
           <a-button @click="closeAction">{{ $t('label.cancel') }}</a-button>
           <a-button :loading="loading" ref="submit" type="primary" 
@click="handleSubmit">{{ $t('label.ok') }}</a-button>

Reply via email to