From 2727dc53eb499f53ff146202b6d8588cc708cab3 Mon Sep 17 00:00:00 2001 From: abhishek Date: Tue, 21 Sep 2010 15:01:57 -0700 Subject: [PATCH] bug 3120: now we provide a 1:1 nat functionality. we acquire a public ip from the ui, and if the 1:1 nat option is chosen, provide a valid vm instance id with it. the backend logic maps this id to a guest ip, and programs the ip table rules to forward all traffic from the public ip acquired, to this guest. for tests, try ssh'ing to that host, using something like ssh root@192.168.30.43 (for this public ip acquired), and you should be able to log into the guest vm status 3120: resolved fixed --- server/src/com/cloud/server/ManagementServerImpl.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/server/src/com/cloud/server/ManagementServerImpl.java b/server/src/com/cloud/server/ManagementServerImpl.java index 2df1bdf1cab..86856f1e5ce 100755 --- a/server/src/com/cloud/server/ManagementServerImpl.java +++ b/server/src/com/cloud/server/ManagementServerImpl.java @@ -1569,6 +1569,14 @@ public class ManagementServerImpl implements ManagementServer { _accountMgr.incrementResourceCount(accountId, ResourceType.public_ip); } + if(vmId!=0){ + VMInstanceVO vm = _vmInstanceDao.findById(vmId); + + if(vm == null){ + throw new InvalidParameterValueException("Invalid vm instance id:"+vmId+" specified"); + } + } + boolean success = true; String errorMsg = "";