ansible-hyperv icon indicating copy to clipboard operation
ansible-hyperv copied to clipboard

network configuration issue

Open rajnathsah opened this issue 2 years ago • 3 comments

I tried network configuration for newly created centos vm, but machine is not accessible outside using ip. On debugging i found, though gateway is getting updated in configuration of centos but when i opened graphical interface, i found gateway is blank.

Below is part of yml file which i am using

- name: Configure VMs IP
  win_hyperv_guest_config_net:
    name: test.example.com
    ip: "172.23.77.146" 
    netmask: "255.255.248.0"
    gateway: "172.23.72.1"
    dns: "172.23.78.176,172.23.78.177"
    type: static 

rajnathsah avatar Oct 27 '21 17:10 rajnathsah

Issue with network configuration is because of ip address getting updated in below format.

IPADDR0=172.23.77.1 NETMASK0=255.255.248.0 GATEWAY=172.23.72.1

Here ap address got updated to IPADDR0 and netmask to NETMASK0 but gateway got updated to GATEWAY. Now in order to make it work, if i manually updare GATEWAY TO GATEWAY0 then it works or if i remove zero from other two. Not sure why this issue is there but if there is any clue to fix this issue then that would be helpful.

rajnathsah avatar Oct 29 '21 11:10 rajnathsah

I had the same issue. The reason why the machine is not accessible is because under networking the vlan tag id is not enabled or and the tag is not defined without this the network will be unreachable.

Someone need to add this

Perfect10NickTailor avatar Oct 12 '22 17:10 Perfect10NickTailor

its an easy fix

add a task in the provisiong code to set the vlanid using the win_shell module.

Cheers

Perfect10NickTailor avatar Oct 13 '22 08:10 Perfect10NickTailor