cloudstack-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CLOUDSTACK-10199) Support requesting a specific IPv4 address in Basic Networking during Instance creation
Date Thu, 03 May 2018 13:26:00 GMT

    [ https://issues.apache.org/jira/browse/CLOUDSTACK-10199?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16462438#comment-16462438
] 

ASF GitHub Bot commented on CLOUDSTACK-10199:
---------------------------------------------

GabrielBrascher commented on a change in pull request #2595: CLOUDSTACK-10199: Support requesting
a specific IPv4 address
URL: https://github.com/apache/cloudstack/pull/2595#discussion_r185795854
 
 

 ##########
 File path: engine/schema/src/main/java/com/cloud/dc/dao/VlanDaoImpl.java
 ##########
 @@ -82,6 +83,24 @@ public VlanVO findByZoneAndVlanId(long zoneId, String vlanId) {
         return findOneBy(sc);
     }
 
+    /**
+     * Returns a vlan by the network id and if the given IPv4 is in the network IP range.
+     */
+    @Override
+    public VlanVO findByNetworkIdAndIpv4Range(long networkId, String ipv4Address) {
+        List<VlanVO> vlanVoList = listVlansByNetworkId(networkId);
+        for (VlanVO vlan : vlanVoList) {
+            String ipRange = vlan.getIpRange();
+            String[] ipRangeParts = ipRange.split("-");
+            String startIP = ipRangeParts[0];
+            String endIP = ipRangeParts[1];
+            if (NetUtils.isIpInRange(ipv4Address, startIP, endIP)) {
 
 Review comment:
   The problem is that I do not have a CIDR. The network CIDR (at least in the basic network)
is null. I like the idea of isIp6InNetwork, but I will need to ignore CIDR at this stage and
use only ipv4 range.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> Support requesting a specific IPv4 address in Basic Networking during Instance creation
> ---------------------------------------------------------------------------------------
>
>                 Key: CLOUDSTACK-10199
>                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10199
>             Project: CloudStack
>          Issue Type: Improvement
>      Security Level: Public(Anyone can view this level - this is the default.) 
>          Components: API
>         Environment: CloudStack 4.10
>            Reporter: Wido den Hollander
>            Priority: Major
>              Labels: basic-networking
>
> DirectPodBasedNetworkGuru does not support requesting a custom IP-Address while creating
a new NIC/Instance.
> {quote}
> Error 530: Does not support custom ip allocation at this time: NicProfile[0-0-null-null-null
> {
>   "cserrorcode": 4250,
>   "errorcode": 530,
>   "errortext": "Does not support custom ip allocation at this time: NicProfile[0-0-null-null-null",
>   "uuidList": []
> }
> {quote}
> Some use-cases prefer the ability to request the IPv4 address which the Instance will
get.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message