You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by re...@apache.org on 2015/11/02 20:33:46 UTC
[1/3] git commit: updated refs/heads/master to 20bbd34
Repository: cloudstack
Updated Branches:
refs/heads/master 2cd789e93 -> 20bbd342c
CLOUDSTACK-9016 Fail to create VM instance within VPC
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/475fc384
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/475fc384
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/475fc384
Branch: refs/heads/master
Commit: 475fc38481d55a846150937c126b91d1b0879bcb
Parents: acce645
Author: Bharat Kumar <bh...@citrix.com>
Authored: Wed Oct 7 16:35:28 2015 +0530
Committer: Bharat Kumar <bh...@citrix.com>
Committed: Mon Nov 2 14:08:19 2015 +0530
----------------------------------------------------------------------
server/src/com/cloud/network/IpAddressManagerImpl.java | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/475fc384/server/src/com/cloud/network/IpAddressManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/IpAddressManagerImpl.java b/server/src/com/cloud/network/IpAddressManagerImpl.java
index 28df971..a78b85f 100644
--- a/server/src/com/cloud/network/IpAddressManagerImpl.java
+++ b/server/src/com/cloud/network/IpAddressManagerImpl.java
@@ -1684,11 +1684,7 @@ public class IpAddressManagerImpl extends ManagerBase implements IpAddressManage
return requestedIp;
}
- String result;
- do {
- result = NetUtils.long2Ip(array[_rand.nextInt(array.length)]);
- } while (result.split("\\.")[3].equals("1"));
- return result;
+ return NetUtils.long2Ip(array[_rand.nextInt(array.length)]);
}
Random _rand = new Random(System.currentTimeMillis());
[3/3] git commit: updated refs/heads/master to 20bbd34
Posted by re...@apache.org.
Merge pull request #1020 from bvbharatk/CLOUDSTACK-9016
CLOUDSTACK-9016 Fail to create VM instance within VPCbug link https://issues.apache.org/jira/browse/CLOUDSTACK-9016.
CS doe not allocate the ip of the form x.x.x.1 to a guest VM. We seem to incorrectly assume that the first ip in the subnet belongs to the gateway.
* pr/1020:
CLOUDSTACK-9016: Deploy vm with gateway ip address in VPC
CLOUDSTACK-9016 Fail to create VM instance within VPC
Signed-off-by: Remi Bergsma <gi...@remi.nl>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/20bbd342
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/20bbd342
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/20bbd342
Branch: refs/heads/master
Commit: 20bbd342cec5d6bbc4fa954fb8b8c9fe5f3a55dc
Parents: 2cd789e 7d1dc04
Author: Remi Bergsma <gi...@remi.nl>
Authored: Mon Nov 2 20:32:56 2015 +0100
Committer: Remi Bergsma <gi...@remi.nl>
Committed: Mon Nov 2 20:32:56 2015 +0100
----------------------------------------------------------------------
.../com/cloud/network/IpAddressManagerImpl.java | 6 +-
test/integration/component/test_vpc.py | 58 ++++++++++++++++++++
2 files changed, 59 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/20bbd342/server/src/com/cloud/network/IpAddressManagerImpl.java
----------------------------------------------------------------------
[2/3] git commit: updated refs/heads/master to 20bbd34
Posted by re...@apache.org.
CLOUDSTACK-9016: Deploy vm with gateway ip address in VPC
Signed-off-by: sanjeev <sa...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/7d1dc04a
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/7d1dc04a
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/7d1dc04a
Branch: refs/heads/master
Commit: 7d1dc04a436e4ad9c7dd72d2382c0c0ea8006df7
Parents: 475fc38
Author: sanjeev <sa...@apache.org>
Authored: Fri Oct 30 19:14:06 2015 +0530
Committer: Bharat Kumar <bh...@citrix.com>
Committed: Mon Nov 2 14:41:25 2015 +0530
----------------------------------------------------------------------
test/integration/component/test_vpc.py | 58 +++++++++++++++++++++++++++++
1 file changed, 58 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7d1dc04a/test/integration/component/test_vpc.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_vpc.py b/test/integration/component/test_vpc.py
index bae89c5..f81f53f 100644
--- a/test/integration/component/test_vpc.py
+++ b/test/integration/component/test_vpc.py
@@ -2432,3 +2432,61 @@ class TestVPC(cloudstackTestCase):
self.assertEqual(vpc_networks[0].displaytext,
new_display_text,
"Updation of VPC display text failed.")
+
+ @attr(tags=["advanced", "intervlan"], required_hardware="false")
+ def test_21_deploy_vm_with_gateway_ip(self):
+ self.services["vpc"]["cidr"] = "192.168.1.0/24"
+ self.debug("creating a VPC network in the account: %s" %
+ self.account.name)
+ vpc = VPC.create(
+ self.apiclient,
+ self.services["vpc"],
+ vpcofferingid=self.vpc_off.id,
+ zoneid=self.zone.id,
+ account=self.account.name,
+ domainid=self.account.domainid
+ )
+ self.validate_vpc_network(vpc)
+ self.network_offering = NetworkOffering.create(
+ self.apiclient,
+ self.services["network_offering"],
+ conservemode=False
+ )
+ # Enable Network offering
+ self.network_offering.update(self.apiclient, state='Enabled')
+ self.cleanup.append(self.network_offering)
+ #Instead of first ip, assigning last ip in the CIDR as the gateway ip
+ gateway = "192.168.1.2"
+ self.services["network"]["netmask"] = "255.255.255.252"
+ # Split the cidr to retrieve gateway
+ # for eg. cidr = 10.0.0.1/24
+ # Gateway = 10.0.0.1
+
+ # Creating network using the network offering created
+ self.debug("Creating network with network offering: %s" %
+ self.network_offering.id)
+ network = Network.create(
+ self.apiclient,
+ self.services["network"],
+ accountid=self.account.name,
+ domainid=self.account.domainid,
+ networkofferingid=self.network_offering.id,
+ zoneid=self.zone.id,
+ gateway=gateway,
+ vpcid=vpc.id
+ )
+ self.debug("Created network with ID: %s" % network.id)
+ vm = VirtualMachine.create(
+ self.apiclient,
+ self.services["virtual_machine"],
+ accountid=self.account.name,
+ domainid=self.account.domainid,
+ serviceofferingid=self.service_offering.id,
+ networkids=[str(network.id)]
+ )
+ self.debug("Deployed VM in network: %s" % network.id)
+ self.assertIsNotNone(
+ vm,
+ "Failed to create VM with first ip address in the CIDR as the vm ip"
+ )
+ return