theforeman / foreman_azure_rm

Adds Azure Resource Manager as a compute resource for The Foreman
GNU General Public License v3.0
9 stars 24 forks source link

Can't set static private IP #181

Open trenta opened 10 months ago

trenta commented 10 months ago

This is related to https://community.theforeman.org/t/azure-vm-deployment-with-static-private-ip-not-setting-static/35589

Foreman and Proxy versions: 3.8

Foreman and Proxy plugin versions: foreman_azure_rm - 2.2.10

I've tried everything I can think of but every vm I create the Nic is dynamic and not static. Happy to provide any further info if required.

Cheers

Trent

trenta commented 8 months ago

I've definitely had the Static Private IP box ticked. When I check the logs on the azure side I get this part which shows it's requested a Dynamic address. "properties": { "requestbody": "{\"location\":\"redacted\",\"properties\":{\"ipConfigurations\":[{\"properties\":{\"privateIPAllocationMethod\":\"Dynamic\",\"subnet\":

trenta commented 8 months ago

And this from the foreman logs "interfaces_attributes"=>{"0"=>{"_destroy"=>"0", "type"=>"Nic::Managed", "mac"=>"", "identifier"=>"", "name"=>"test-az-01", "domain_id"=>"1", "subnet_id"=>"19", "ip"=>"10.210.0.221", "ip6"=>"", "managed"=>"1", "primary"=>"1", "provision"=>"1", "virtual"=>"0", "tag"=>"", "attached_to"=>"", "compute_attributes"=>{"network"=>"/subscriptions/redacted/resourceGroups/Az_Infra/providers/Microsoft.Network/virtualNetworks/vnet01/subnets/webservers", "public_ip"=>"None", "private_ip"=>""}}}, I'm leaving the ip in because it doesn't disclose anything but it looks like this module isn't passing the ip to the network call.

trenta commented 8 months ago

So private_ip should be true or false rather than an empty string right?

chris1984 commented 8 months ago

You are right it should be a Boolean value instead of a string or empty string in this case. @stejskalleos do you want to add this to your radar to fix or want me to add it to our team sprint?

stejskalleos commented 8 months ago

@chris1984 feel free to proceed on your own

chris1984 commented 8 months ago

I am back to work now, will get this added to this sprint and start working on it