You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by GitBox <gi...@apache.org> on 2021/08/06 13:38:11 UTC

[GitHub] [cloudstack-terraform-provider] ccycv opened a new issue #2: Can't enable static, ip address Ip[5.xxx.xxx.xx-1] is a sourceNat ip address

ccycv opened a new issue #2:
URL: https://github.com/apache/cloudstack-terraform-provider/issues/2


   
   **If I add the bellow option to the terraform, I get this error in the first deploy**:
   
   ```
   cloudstack_network.terra-net: Creating...
   cloudstack_network.terra-net: Creation complete after 1s [id=f0b8709c-6013-4d80-9075-cc26b826f5a6]
   cloudstack_ipaddress.default: Creating...
   cloudstack_instance.web: Creating...
   cloudstack_ipaddress.default: Creation complete after 0s [id=907d5b89-cf2f-4109-ba83-78e620a5b431]
   cloudstack_firewall.default: Creating...
   cloudstack_instance.web: Still creating... [10s elapsed]
   cloudstack_instance.web: Still creating... [20s elapsed]
   cloudstack_instance.web: Still creating... [30s elapsed]
   cloudstack_instance.web: Still creating... [40s elapsed]
   cloudstack_instance.web: Still creating... [50s elapsed]
   cloudstack_instance.web: Still creating... [1m0s elapsed]
   cloudstack_instance.web: Still creating... [1m10s elapsed]
   cloudstack_instance.web: Creation complete after 1m19s [id=00fa3d62-0d22-470d-81fc-477bbc5d3bea]
   cloudstack_static_nat.default: Creating...
   ╷
   │ Error: Error enabling static NAT: CloudStack API error 431 (CSExceptionErrorCode: 4350): Can't enable static, ip address Ip[5.xxx.xx.xx-1] is a sourceNat ip address
   │
   │   with cloudstack_static_nat.default,
   │   on acs.tf line 49, in resource "cloudstack_static_nat" "default":
   │   49: resource "cloudstack_static_nat" "default" {
   │
   ╵
   ╷
   │ Error: 1 error occurred:
   │       * Undefined error: {"errorcode":530,"errortext":"Failed to create firewall rule"}
   │
   │
   │
   │   with cloudstack_firewall.default,
   │   on acs.tf line 60, in resource "cloudstack_firewall" "default":
   │   60: resource "cloudstack_firewall" "default" {
   │
   `╵`
   ```
   If I do another run after this, it will work, the problem is that only 1 public IP is allocated by default and the default one is with source NAT which can not be changed to static NAT.
   
   Is there a way to specify the public IP quantity? ( like it is possible via API ) or how can be this done only with 1 run?
   
   
   **This is how the deploy code looks.**
   
   ```
   resource "cloudstack_network" "terra-net" {
     name             = "terra-net"
     cidr             = "10.200.0.0/24"
     network_offering = "eb986523-8375-4824-8091-126a61e6ef05"
     zone             = "DE-001"
   }
   resource "cloudstack_instance" "web" {
     name             = "terratestacs"
     service_offering = "Micro"
     network_id       = cloudstack_network.terra-net.id
     template         = "7c01984d-f5ab-4638-b7a0-cb427f49523d"
     zone             = "DE-001"
     keypair          = "terrakey"
   
     user_data = <<-EOF
                   #!/bin/bash
                   sudo apt update -y
                   sudo apt install apache2 -y
                   sudo systemctl start apache2
                   sudo bash -c 'It is up > /var/www/html/index.html'
                   systemctl enable apache2.service             
                   EOF
     #expunge = true
     root_disk_size   = "10"
   }
   
   resource "cloudstack_ipaddress" "default" {
     network_id = cloudstack_network.terra-net.id
   }
   
   resource "cloudstack_static_nat" "default" {
     ip_address_id      = cloudstack_ipaddress.default.id  
     virtual_machine_id = cloudstack_instance.web.id
   }
   
   output "acs_ip_address" {
     value = cloudstack_instance.web.ip_address
     
   }
   
   
   resource "cloudstack_firewall" "default" {
     ip_address_id = cloudstack_ipaddress.default.id
   
     rule {
       cidr_list = ["0.0.0.0/0"]
       protocol  = "tcp"
       ports     = ["80", "443", "22"]
     }
   }
     
   ```


-- 
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: dev-unsubscribe@cloudstack.apache.org

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



[GitHub] [cloudstack-terraform-provider] harikrishna-patnala closed issue #2: Can't enable static, ip address Ip[5.xxx.xxx.xx-1] is a sourceNat ip address

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala closed issue #2:
URL: https://github.com/apache/cloudstack-terraform-provider/issues/2


   


-- 
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: dev-unsubscribe@cloudstack.apache.org

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



[GitHub] [cloudstack-terraform-provider] harikrishna-patnala commented on issue #2: Can't enable static, ip address Ip[5.xxx.xxx.xx-1] is a sourceNat ip address

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala commented on issue #2:
URL: https://github.com/apache/cloudstack-terraform-provider/issues/2#issuecomment-943007000


   Hi @ccycv 
   I've tried the same config that you have mentioned and I got the same error "Can't enable static, ip address Ip[10.x.x.x-1] is a sourceNat ip address" and this is a valid error.  Even on multiple tries I get the same error. Only when I acquire a new IP and apply static NAT then it got successful.
   
   So let me know if you are fine with this, then we can close the issue.


-- 
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: dev-unsubscribe@cloudstack.apache.org

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



[GitHub] [cloudstack-terraform-provider] harikrishna-patnala commented on issue #2: Can't enable static, ip address Ip[5.xxx.xxx.xx-1] is a sourceNat ip address

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala commented on issue #2:
URL: https://github.com/apache/cloudstack-terraform-provider/issues/2#issuecomment-945463927


   Hi @ccycv, I'm closing the ticket as the error seems valid. Please reopen in case if anything to add.


-- 
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: dev-unsubscribe@cloudstack.apache.org

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



[GitHub] [cloudstack-terraform-provider] rhtyd commented on issue #2: Can't enable static, ip address Ip[5.xxx.xxx.xx-1] is a sourceNat ip address

Posted by GitBox <gi...@apache.org>.
rhtyd commented on issue #2:
URL: https://github.com/apache/cloudstack-terraform-provider/issues/2#issuecomment-895004414


   Hi @ccycv did it used to work with an older version of the TF provider? 


-- 
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: dev-unsubscribe@cloudstack.apache.org

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