updated vm_launch params

This commit is contained in:
2025-03-17 23:04:27 +10:30
parent a80c3fc59f
commit a59f20b74c
3 changed files with 236 additions and 66 deletions
+6 -8
View File
@@ -71,17 +71,15 @@ def render():
if submit and selected_vdc_name_create and vm_name:
# Use the selected VDC's ID
vdc_id = vdc_options[selected_vdc_name_create]
vm_config = {
"memory": memory,
"vcpu": vcpu,
"volumes": st.session_state.volumes,
"networks": [{"id": net_id} for net_id in selected_network_ids]
}
result = st.session_state.client.create_virtual_machine({
"vdc": vdc_id,
"virtual-machines": [{
"virtual_machine_name": vm_name,
"virtual_machine_config": vm_config
"name": vm_name,
"memory": memory,
"vcpu": vcpu,
"volumes": st.session_state.volumes,
"networks": [{"id": net_id} for net_id in selected_network_ids]
}]
})
if result: