Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
eccb2e3
Show Usage Server configuration in a separate pane
abh1sar Oct 1, 2024
fb46785
UI: Option to attach volume to an instance during create volume
abh1sar Oct 2, 2024
c087de4
Merge branch '4.19'
DaanHoogland Oct 2, 2024
0a097c4
Show service ip in management server details tab
abh1sar Oct 3, 2024
0d024c3
change Schedule Snapshots to Recurring Snapshots
abh1sar Oct 3, 2024
f53092e
Change the hypervisor order so that kvm, vmware, xenserver show up first
abh1sar Oct 3, 2024
a79b603
Remove extra space in hypervisor names in config.java
abh1sar Oct 4, 2024
d6181d5
Fix `updateTemplatePermission` when the UI is set to a language other…
lucas-a-martins Oct 4, 2024
e666800
Autofill vcenter details in add cluster form
abh1sar Oct 6, 2024
88ad004
UI: condition to display create vm-vol-snapshots to same as create vo…
abh1sar Oct 6, 2024
8fdfbdd
Merge remote-tracking branch 'upstream/main' into ui-improv
abh1sar Oct 10, 2024
c2174f4
Fix alignment on wrapping in global settings tabs
abh1sar Oct 18, 2024
e0fe1c7
rename Autofill vCenter credentials to Autofill vCenter credentials f…
abh1sar Oct 18, 2024
90f8300
Rename Service Ip to Ip Address in management server response
abh1sar Oct 18, 2024
b6ae5fa
Change description of kvm.snapshot.enabled to say that it applies to …
abh1sar Oct 18, 2024
df6672d
Return error when kvm vm snapshot is taken withoutsnapshot memory
abh1sar Oct 22, 2024
5224243
Minor naming changes and grammar
abh1sar Oct 23, 2024
cd1fa9e
Merge remote-tracking branch 'upstream/main' into ui-improv
abh1sar Oct 23, 2024
320b7f0
Fix tooltip for attach volume to instance button
abh1sar Oct 29, 2024
e289502
Merge branch 'main' into ui-improv
borisstoyanov Nov 13, 2024
e3991bf
Show Usage Server configuration in a separate pane
abh1sar Oct 1, 2024
f97321c
UI: Option to attach volume to an instance during create volume
abh1sar Oct 2, 2024
0acaa77
Show service ip in management server details tab
abh1sar Oct 3, 2024
019b8dd
change Schedule Snapshots to Recurring Snapshots
abh1sar Oct 3, 2024
4d198ee
Change the hypervisor order so that kvm, vmware, xenserver show up first
abh1sar Oct 3, 2024
79203b6
Remove extra space in hypervisor names in config.java
abh1sar Oct 4, 2024
1086c42
Autofill vcenter details in add cluster form
abh1sar Oct 6, 2024
a352c47
UI: condition to display create vm-vol-snapshots to same as create vo…
abh1sar Oct 6, 2024
5b9df20
Fix alignment on wrapping in global settings tabs
abh1sar Oct 18, 2024
2d936d9
rename Autofill vCenter credentials to Autofill vCenter credentials f…
abh1sar Oct 18, 2024
4f5edd5
Rename Service Ip to Ip Address in management server response
abh1sar Oct 18, 2024
0488e17
Change description of kvm.snapshot.enabled to say that it applies to …
abh1sar Oct 18, 2024
d0f044f
Return error when kvm vm snapshot is taken withoutsnapshot memory
abh1sar Oct 22, 2024
f694d2f
Minor naming changes and grammar
abh1sar Oct 23, 2024
2919d53
Fix tooltip for attach volume to instance button
abh1sar Oct 29, 2024
416e78d
Merge branch 'ui-improv' of https://github.com/abh1sar/cloudstack int…
abh1sar Dec 1, 2024
8d79c4c
Show Usage Server configuration in a separate pane
abh1sar Oct 1, 2024
92a8896
UI: Option to attach volume to an instance during create volume
abh1sar Oct 2, 2024
dc85057
Show service ip in management server details tab
abh1sar Oct 3, 2024
5957396
change Schedule Snapshots to Recurring Snapshots
abh1sar Oct 3, 2024
e6ec31a
Change the hypervisor order so that kvm, vmware, xenserver show up first
abh1sar Oct 3, 2024
feb4791
Remove extra space in hypervisor names in config.java
abh1sar Oct 4, 2024
eac913d
Autofill vcenter details in add cluster form
abh1sar Oct 6, 2024
8b362f0
UI: condition to display create vm-vol-snapshots to same as create vo…
abh1sar Oct 6, 2024
7dd5a59
Fix alignment on wrapping in global settings tabs
abh1sar Oct 18, 2024
4112a1e
rename Autofill vCenter credentials to Autofill vCenter credentials f…
abh1sar Oct 18, 2024
020be6c
Rename Service Ip to Ip Address in management server response
abh1sar Oct 18, 2024
8bc6bf4
Change description of kvm.snapshot.enabled to say that it applies to …
abh1sar Oct 18, 2024
736fce9
Return error when kvm vm snapshot is taken withoutsnapshot memory
abh1sar Oct 22, 2024
0cfa879
Minor naming changes and grammar
abh1sar Oct 23, 2024
c221a9e
Fix tooltip for attach volume to instance button
abh1sar Oct 29, 2024
92d8c3e
UI: Option to attach volume to an instance during create volume
abh1sar Oct 2, 2024
27ab123
UI: condition to display create vm-vol-snapshots to same as create vo…
abh1sar Oct 6, 2024
145e7ab
Merge branch 'ui-improv' of https://github.com/abh1sar/cloudstack int…
abh1sar Dec 3, 2024
2f72e5b
moved db changes from 41900to42000 to 42000to42010
abh1sar Dec 3, 2024
2ffca62
Merge remote-tracking branch 'upstream/4.20' into ui-polish
abh1sar Dec 4, 2024
e7ffd8c
Update group_id in already present usage configuration settings
abh1sar Dec 6, 2024
92a3dcd
Merge branch '4.20' into ui-improv
abh1sar Dec 17, 2024
475df60
Merge remote-tracking branch 'upstream/4.20' into ui-polish
abh1sar Jan 13, 2025
a7a8cdf
remove "schedule" from message in create Recurring Snapshots form
abh1sar Jan 13, 2025
6442663
Merge branch '4.20' into ui-improv
abh1sar Jan 24, 2025
c59c122
Update server/src/main/java/com/cloud/vm/snapshot/VMSnapshotManagerIm…
andrijapanicsb Feb 5, 2025
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
Prev Previous commit
Next Next commit
UI: Option to attach volume to an instance during create volume
  • Loading branch information
abh1sar committed Oct 2, 2024
commit fb467854bc3bc729a546e989c0df42a5b380d4cf
1 change: 1 addition & 0 deletions ui/public/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"label.action": "Action",
"label.action.attach.disk": "Attach disk",
"label.action.attach.iso": "Attach ISO",
"label.action.attach.to.instance": "Attach to Instance",
"label.action.bulk.delete.egress.firewall.rules": "Bulk delete egress firewall rules",
"label.action.bulk.delete.firewall.rules": "Bulk delete firewall rules",
"label.action.bulk.delete.ip.v6.firewall.rules": "Bulk remove IPv6 firewall rules",
Expand Down
100 changes: 97 additions & 3 deletions ui/src/views/storage/CreateVolume.vue
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,48 @@
:placeholder="apiParams.maxiops.description"/>
</a-form-item>
</span>
<a-form-item name="attachVolume" ref="attachVolume" v-if="!createVolumeFromVM">
<template #label>
<tooltip-label :title="$t('label.action.attach.to.instance')" :tooltip="$t('label.attachdisk')" />
</template>
<a-switch v-model:checked="form.attachVolume" :checked="attachVolume" @change="zone => onChangeAttachToVM(zone.id)" />
</a-form-item>
<span v-if="attachVolume">
<a-form-item :label="$t('label.virtualmachineid')" name="virtualmachineid" ref="virtualmachineid">
<a-select
v-focus="true"
v-model:value="form.virtualmachineid"
:placeholder="attachVolumeApiParams.virtualmachineid.description"
showSearch
optionFilterProp="label"
:filterOption="(input, option) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
}" >
<a-select-option v-for="vm in virtualmachines" :key="vm.id" :label="vm.name || vm.displayname">
{{ vm.name || vm.displayname }}
</a-select-option>
</a-select>
</a-form-item >
<a-form-item :label="$t('label.deviceid')">
<div style="margin-bottom: 10px">
<a-collapse>
<a-collapse-panel header="More information about deviceID">
<a-alert type="warning">
<template #message>
<span v-html="attachVolumeApiParams.deviceid.description" />
</template>
</a-alert>
</a-collapse-panel>
</a-collapse>
</div>
<a-input-number
v-model:value="form.deviceid"
style="width: 100%;"
:min="0"
:placeholder="$t('label.deviceid')"
/>
</a-form-item>
</span>
<div :span="24" class="action-button">
<a-button @click="closeModal">{{ $t('label.cancel') }}</a-button>
<a-button type="primary" ref="submit" @click="handleSubmit">{{ $t('label.ok') }}</a-button>
Expand Down Expand Up @@ -159,7 +201,10 @@ export default {
offerings: [],
customDiskOffering: false,
loading: false,
isCustomizedDiskIOps: false
isCustomizedDiskIOps: false,
virtualmachines: [],
attachVolume: false,
vmidtoattach: null
}
},
computed: {
Expand Down Expand Up @@ -204,6 +249,10 @@ export default {
}
}]
})
if (this.attachVolume) {
this.rules.virtualmachineid = [{ required: true, message: this.$t('message.error.select') }]
this.rules.deviceid = [{ required: true, message: this.$t('message.error.select') }]
}
if (!this.createVolumeFromSnapshot) {
this.rules.name = [{ required: true, message: this.$t('message.error.volume.name') }]
this.rules.diskofferingid = [{ required: true, message: this.$t('message.error.select') }]
Expand Down Expand Up @@ -248,6 +297,9 @@ export default {
this.zones = json.listzonesresponse.zone || []
this.form.zoneid = this.zones[0].id || ''
this.fetchDiskOfferings(this.form.zoneid)
if (this.attachVolume) {
this.fetchVirtualMachines(this.form.zoneid)
}
}).finally(() => {
this.loading = false
})
Expand Down Expand Up @@ -301,6 +353,31 @@ export default {
this.loading = false
})
},
fetchVirtualMachines (zoneId) {
var params = {
zoneid: zoneId,
details: 'min'
}
if (this.owner.projectid) {
params.projectid = this.owner.projectid
} else {
params.account = this.owner.account
params.domainid = this.owner.domainid
}

this.loading = true
var vmStates = ['Running', 'Stopped']
vmStates.forEach((state) => {
params.state = state
api('listVirtualMachines', params).then(response => {
this.virtualmachines = this.virtualmachines.concat(response.listvirtualmachinesresponse.virtualmachine || [])
}).catch(error => {
this.$notifyError(error)
}).finally(() => {
this.loading = false
})
})
},
handleSubmit (e) {
if (this.loading) return
this.formRef.value.validate().then(() => {
Expand All @@ -315,6 +392,10 @@ export default {
if (this.createVolumeFromSnapshot) {
values.snapshotid = this.resource.id
}
if (this.attachVolume) {
this.vmidtoattacch = values.virtualmachineid
values.virtualmachineid = null
}
values.domainid = this.owner.domainid
if (this.owner.projectid) {
values.projectid = this.owner.projectid
Expand All @@ -330,10 +411,15 @@ export default {
successMessage: this.$t('message.success.create.volume'),
successMethod: (result) => {
this.closeModal()
if (this.createVolumeFromVM) {
if (this.createVolumeFromVM || this.attachVolume) {
const params = {}
params.id = result.jobresult.volume.id
params.virtualmachineid = this.resource.id
if (this.createVolumeFromVM) {
params.virtualmachineid = this.resource.id
} else {
params.virtualmachineid = this.vmidtoattach
params.deviceid = values.deviceid
}
api('attachVolume', params).then(response => {
this.$pollJob({
jobId: response.attachvolumeresponse.jobid,
Expand Down Expand Up @@ -368,6 +454,14 @@ export default {
const offering = this.offerings.filter(x => x.id === id)
this.customDiskOffering = offering[0]?.iscustomized || false
this.isCustomizedDiskIOps = offering[0]?.iscustomizediops || false
},
onChangeAttachToVM (zone) {
this.attachVolume = !this.attachVolume
this.virtualmachines = []
if (this.attachVolume) {
this.attachVolumeApiParams = this.$getApiParams('attachVolume')
this.fetchVirtualMachines(this.form.zoneid)
}
}
}
}
Expand Down