You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2020/11/05 12:17:28 UTC

[GitHub] [cloudstack] slavkap opened a new issue #4450: Failed to create Guest Network during basic installation

slavkap opened a new issue #4450:
URL: https://github.com/apache/cloudstack/issues/4450


   <!--
   Verify first that your issue/request is not already reported on GitHub.
   Also test if the latest release and master branch are affected too.
   Always add information AFTER of these HTML comments, but no need to delete the comments.
   -->
   
   ##### ISSUE TYPE
   <!-- Pick one below and delete the rest -->
    * Bug Report
   
   ##### COMPONENT NAME
   
   ~~~
   network
   ~~~
   
   ##### CLOUDSTACK VERSION
   
   ~~~
   branch 4.13 and master
   ~~~
   
   ##### CONFIGURATION
   <!--
   basic network configuration
   -->
   
   
   ##### OS / ENVIRONMENT
   <!--
   -->
   ~~~
   CentOS7
   ~~~
   
   ##### SUMMARY
   <!-- Explain the problem/feature briefly -->
   
   Using the basic installation wizard it's not possible to create a guest network, because the "isolationmethods" are not provided, and an exception is thrown:
   
   `java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0
           at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
           at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
           at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:248)
           at java.base/java.util.Objects.checkIndex(Objects.java:372)
           at java.base/java.util.ArrayList.get(ArrayList.java:459)
           at org.apache.cloudstack.engine.orchestration.NetworkOrchestrator.encodeVlanIdIntoBroadcastUri(NetworkOrchestrator.java:2674)
           at org.apache.cloudstack.engine.orchestration.NetworkOrchestrator.createGuestNetwork(NetworkOrchestrator.java:2447)
           at org.apache.cloudstack.engine.orchestration.NetworkOrchestrator.createGuestNetwork(NetworkOrchestrator.java:2327)
           at com.cloud.network.NetworkServiceImpl$4.doInTransaction(NetworkServiceImpl.java:1502)
           at com.cloud.network.NetworkServiceImpl$4.doInTransaction(NetworkServiceImpl.java:1450)
           at com.cloud.utils.db.Transaction.execute(Transaction.java:40)
   `
   
   According to the API documentation for createPhysicalNetwork the "isolationmethods" parameter is not mandatory, and the list of IsolationMethod in my case is emtpy.
   
   
   ```
    protected URI encodeVlanIdIntoBroadcastUri(String vlanId, PhysicalNetwork pNtwk) {
           if (pNtwk == null) {
               throw new InvalidParameterValueException(String.format("Failed to encode VLAN/VXLAN %s into a Broadcast URI. Physical Network cannot be null.", vlanId));
           }
   
           if(StringUtils.isNotBlank(pNtwk.getIsolationMethods().get(0))) {
               String isolationMethod = pNtwk.getIsolationMethods().get(0).toLowerCase();
               String vxlan = BroadcastDomainType.Vxlan.toString().toLowerCase();
               if(isolationMethod.equals(vxlan)) {
                   return BroadcastDomainType.encodeStringIntoBroadcastUri(vlanId, BroadcastDomainType.Vxlan);
               }
           }
           return BroadcastDomainType.fromString(vlanId);
       }
   ```
   
   With remote debug I have set one blank element in the list, and the installation was successful.


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] slavkap commented on issue #4450: Failed to create Guest Network during basic installation

Posted by GitBox <gi...@apache.org>.
slavkap commented on issue #4450:
URL: https://github.com/apache/cloudstack/issues/4450#issuecomment-725627381


   Thanks @GabrielBrascher! I will do the fix to check if it's not empty. It has to be pushed on branch 4.13? Maybe I have to think about switching to Advance network on my dev. environment


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] GabrielBrascher commented on issue #4450: Failed to create Guest Network during basic installation

Posted by GitBox <gi...@apache.org>.
GabrielBrascher commented on issue #4450:
URL: https://github.com/apache/cloudstack/issues/4450#issuecomment-722373376


   As far as I know, this method is executed only when the network has been created with a VLAN ID, therefore, an isolation method should be provided (e.g. VLAN or VXLAN).
   
   Did you provide any VLAN ID when creating the network?
   
   For reference, this method was added by PR #4190.


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] GabrielBrascher commented on issue #4450: Failed to create Guest Network during basic installation

Posted by GitBox <gi...@apache.org>.
GabrielBrascher commented on issue #4450:
URL: https://github.com/apache/cloudstack/issues/4450#issuecomment-722397466


   Thanks @slavkap, I will take another look at this.


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] GabrielBrascher commented on issue #4450: Failed to create Guest Network during basic installation

Posted by GitBox <gi...@apache.org>.
GabrielBrascher commented on issue #4450:
URL: https://github.com/apache/cloudstack/issues/4450#issuecomment-725799917


   @slavkap pushing it into 4.13 sounds good.


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] slavkap commented on issue #4450: Failed to create Guest Network during basic installation

Posted by GitBox <gi...@apache.org>.
slavkap commented on issue #4450:
URL: https://github.com/apache/cloudstack/issues/4450#issuecomment-723831176


   I could fix this issue, but I'm not very familiar with this part of CloudStack. Do we have to provide isolation method for basic network? For basic network the vlanId has to be null according to the code, and encodeVlanIdIntoBroadcastUri() will be executed
   ```
               if (vlanId == null) {
                   vlanId = Vlan.UNTAGGED;
               } else {
                   if (!vlanId.equalsIgnoreCase(Vlan.UNTAGGED)) {
                       throw new InvalidParameterValueException("Only vlan " + Vlan.UNTAGGED + " can be created in " + "the zone of type " + NetworkType.Basic);
                   }
               }
   ```
   or only we need to check that the list is empty when encoding the vlan
   `        if(StringUtils.isNotBlank(pNtwk.getIsolationMethods().get(0))) {
   `


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] slavkap edited a comment on issue #4450: Failed to create Guest Network during basic installation

Posted by GitBox <gi...@apache.org>.
slavkap edited a comment on issue #4450:
URL: https://github.com/apache/cloudstack/issues/4450#issuecomment-723831176


   I could fix this issue, but I'm not very familiar with this part of CloudStack. Do we have to provide isolation method for basic network? For basic network the vlanId has to be null according to the code or UNTAGGED, and encodeVlanIdIntoBroadcastUri() will be executed
   ```
               if (vlanId == null) {
                   vlanId = Vlan.UNTAGGED;
               } else {
                   if (!vlanId.equalsIgnoreCase(Vlan.UNTAGGED)) {
                       throw new InvalidParameterValueException("Only vlan " + Vlan.UNTAGGED + " can be created in " + "the zone of type " + NetworkType.Basic);
                   }
               }
   ```
   or only we need to check that the list is empty when encoding the vlan
   `        if(StringUtils.isNotBlank(pNtwk.getIsolationMethods().get(0))) {
   `


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] DaanHoogland commented on issue #4450: Failed to create Guest Network during basic installation

Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on issue #4450:
URL: https://github.com/apache/cloudstack/issues/4450#issuecomment-731076655


   fixed in #4464


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] slavkap edited a comment on issue #4450: Failed to create Guest Network during basic installation

Posted by GitBox <gi...@apache.org>.
slavkap edited a comment on issue #4450:
URL: https://github.com/apache/cloudstack/issues/4450#issuecomment-722389386


   Thanks @GabrielBrascher 
   I'm seting up CS with basic network through the installation wizard, and didn't provide VLAN Id, because you're limited in options when using the wizard 
   
   ![Screenshot from 2020-11-05 15-38-03](https://user-images.githubusercontent.com/51903378/98248806-1d216400-1f7e-11eb-892f-5376eb98a639.png)
   ![Screenshot from 2020-11-05 15-39-20](https://user-images.githubusercontent.com/51903378/98248811-1eeb2780-1f7e-11eb-9887-e80f43da7d22.png)
   ![Screenshot from 2020-11-05 15-46-20](https://user-images.githubusercontent.com/51903378/98248815-1f83be00-1f7e-11eb-9a6b-ff3c816110ff.png)
   
   
   And forgot to mention that I'm using the old UI


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] DaanHoogland closed issue #4450: Failed to create Guest Network during basic installation

Posted by GitBox <gi...@apache.org>.
DaanHoogland closed issue #4450:
URL: https://github.com/apache/cloudstack/issues/4450


   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] GabrielBrascher commented on issue #4450: Failed to create Guest Network during basic installation

Posted by GitBox <gi...@apache.org>.
GabrielBrascher commented on issue #4450:
URL: https://github.com/apache/cloudstack/issues/4450#issuecomment-725618942


   @slavkap both options look good, I would go for checking if it is not empty therefore in case of empty the code does not change the execution flow..
   
   Regarding the basic network question; the basic network is particular by not providing any isolation method, it considers simply a range of (public) IPs provided with no isolation at all.
   
   Note that the Basic network shall be deprecated in the medium/long term. CloudStack primate, for instance, does not support creation of basic netowrks, only maintaining existing basic network zones via UI; one can still deploy new basic zones via API.


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] slavkap commented on issue #4450: Failed to create Guest Network during basic installation

Posted by GitBox <gi...@apache.org>.
slavkap commented on issue #4450:
URL: https://github.com/apache/cloudstack/issues/4450#issuecomment-722389386


   Thanks @GabrielBrascher 
   I'm seting up CS with basic network though the installation wizard, and didn't provide VLAN Id, because you're limited in options when using the wizard 
   
   ![Screenshot from 2020-11-05 15-38-03](https://user-images.githubusercontent.com/51903378/98248806-1d216400-1f7e-11eb-892f-5376eb98a639.png)
   ![Screenshot from 2020-11-05 15-39-20](https://user-images.githubusercontent.com/51903378/98248811-1eeb2780-1f7e-11eb-9887-e80f43da7d22.png)
   ![Screenshot from 2020-11-05 15-46-20](https://user-images.githubusercontent.com/51903378/98248815-1f83be00-1f7e-11eb-9a6b-ff3c816110ff.png)
   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] slavkap edited a comment on issue #4450: Failed to create Guest Network during basic installation

Posted by GitBox <gi...@apache.org>.
slavkap edited a comment on issue #4450:
URL: https://github.com/apache/cloudstack/issues/4450#issuecomment-722389386


   Thanks @GabrielBrascher 
   I'm seting up CS with basic network through the installation wizard, and didn't provide VLAN Id, because you're limited in options when using the wizard 
   
   ![Screenshot from 2020-11-05 15-38-03](https://user-images.githubusercontent.com/51903378/98248806-1d216400-1f7e-11eb-892f-5376eb98a639.png)
   ![Screenshot from 2020-11-05 15-39-20](https://user-images.githubusercontent.com/51903378/98248811-1eeb2780-1f7e-11eb-9887-e80f43da7d22.png)
   ![Screenshot from 2020-11-05 15-46-20](https://user-images.githubusercontent.com/51903378/98248815-1f83be00-1f7e-11eb-9a6b-ff3c816110ff.png)
   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] GabrielBrascher commented on issue #4450: Failed to create Guest Network during basic installation

Posted by GitBox <gi...@apache.org>.
GabrielBrascher commented on issue #4450:
URL: https://github.com/apache/cloudstack/issues/4450#issuecomment-722377444


   @slavkap can you please provide some details so I can reproduce the same operation in order to debug it? Thanks!


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org