MCPcopy Create free account
hub / github.com/Dstack-TEE/dstack / cloneConfig

Function cloneConfig

vmm/ui/src/composables/useVmManager.ts:1143–1176  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1141 }
1142
1143 async function cloneConfig() {
1144 try {
1145 const source = cloneConfigDialog.value;
1146 if (!source.compose_file) {
1147 alert('Compose file not available for this VM. Please open its details first.');
1148 return;
1149 }
1150 const payload = buildCreateVmPayload({
1151 name: source.name,
1152 image: source.image,
1153 compose_file: source.compose_file,
1154 vcpu: source.vcpu,
1155 memory: source.memory,
1156 disk_size: source.disk_size,
1157 ports: source.ports,
1158 encrypted_env: source.encrypted_env,
1159 app_id: source.app_id,
1160 user_config: source.user_config,
1161 hugepages: source.hugepages,
1162 pin_numa: source.pin_numa,
1163 no_tee: source.no_tee,
1164 gpus: source.gpus,
1165 kms_urls: source.kms_urls,
1166 gateway_urls: source.gateway_urls,
1167 stopped: source.stopped,
1168 });
1169 await vmmRpc.createVm(payload);
1170 cloneConfigDialog.value.show = false;
1171 loadVMList();
1172 } catch (error) {
1173 recordError('Error creating VM', error);
1174 alert('Failed to create VM');
1175 }
1176 }
1177
1178 function toggleDetails(vm: VmListItem) {
1179 if (expandedVMs.value.has(vm.id)) {

Callers

nothing calls this directly

Calls 3

buildCreateVmPayloadFunction · 0.85
loadVMListFunction · 0.85
recordErrorFunction · 0.85

Tested by

no test coverage detected