DaanHoogland commented on a change in pull request #5216:
URL: https://github.com/apache/cloudstack/pull/5216#discussion_r692792394



##########
File path: server/src/main/java/com/cloud/vm/UserVmManagerImpl.java
##########
@@ -5494,6 +5742,82 @@ public UserVm createVirtualMachine(DeployVMCmd cmd) 
throws InsufficientCapacityE
         return vm;
     }
 
+    @Override
+    public UserVm recordVirtualMachineToDB(CloneVMCmd cmd, long templateId) 
throws ConcurrentOperationException, ResourceAllocationException, 
InsufficientCapacityException, ResourceUnavailableException {
+        //network configurations and check, then create the template
+        UserVm curVm = cmd.getTargetVM();
+        // check if host is available
+        Long hostId = curVm.getHostId();
+        getDestinationHost(hostId, true);
+        Long zoneId = curVm.getDataCenterId();
+        DataCenter dataCenter = _entityMgr.findById(DataCenter.class, zoneId);
+        Map<String, String> vmProperties = curVm.getDetails() != null ? 
curVm.getDetails() : new HashMap<>();
+        String keyboard = vmProperties.get(VmDetailConstants.KEYBOARD);
+        HypervisorType hypervisorType = curVm.getHypervisorType();
+        Account curAccount = _accountDao.findById(curVm.getAccountId());
+        long callingUserId = CallContext.current().getCallingUserId();
+        Account callerAccount = CallContext.current().getCallingAccount();
+//        IpAddress ipAddress = _ipAddrMgr.assignPublicIpAddress(zoneId, 
curVm.getPodIdToDeployIn(), callerAccount, VlanType.DirectAttached, )
+//        IpAddress ipAddress = _ipAddrMgr.allocateIp(curAccount, false, 
callerAccount, callingUserId, dataCenter, true, null);

Review comment:
       please remove

##########
File path: server/src/main/java/com/cloud/vm/UserVmManagerImpl.java
##########
@@ -5494,6 +5742,82 @@ public UserVm createVirtualMachine(DeployVMCmd cmd) 
throws InsufficientCapacityE
         return vm;
     }
 
+    @Override
+    public UserVm recordVirtualMachineToDB(CloneVMCmd cmd, long templateId) 
throws ConcurrentOperationException, ResourceAllocationException, 
InsufficientCapacityException, ResourceUnavailableException {
+        //network configurations and check, then create the template
+        UserVm curVm = cmd.getTargetVM();
+        // check if host is available
+        Long hostId = curVm.getHostId();
+        getDestinationHost(hostId, true);
+        Long zoneId = curVm.getDataCenterId();
+        DataCenter dataCenter = _entityMgr.findById(DataCenter.class, zoneId);
+        Map<String, String> vmProperties = curVm.getDetails() != null ? 
curVm.getDetails() : new HashMap<>();
+        String keyboard = vmProperties.get(VmDetailConstants.KEYBOARD);
+        HypervisorType hypervisorType = curVm.getHypervisorType();
+        Account curAccount = _accountDao.findById(curVm.getAccountId());
+        long callingUserId = CallContext.current().getCallingUserId();
+        Account callerAccount = CallContext.current().getCallingAccount();
+//        IpAddress ipAddress = _ipAddrMgr.assignPublicIpAddress(zoneId, 
curVm.getPodIdToDeployIn(), callerAccount, VlanType.DirectAttached, )
+//        IpAddress ipAddress = _ipAddrMgr.allocateIp(curAccount, false, 
callerAccount, callingUserId, dataCenter, true, null);
+        String ipv6Address = null;
+        String macAddress = null;
+        IpAddresses addr = new IpAddresses(null, ipv6Address, macAddress);
+//        IpAddresses addr = new IpAddresses("172.20.0.98", ipv6Address, 
macAddress);

Review comment:
       please remove




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to