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

Mice Xia commented on CLOUDSTACK-107:
-------------------------------------

[Root Cause]

When creating a VM with multiple NICs, each NIC acquired DNS server info from 
their corresponding vRouter via DHCP; on CentOS, DNS and Search Domain are 
written to /etc/resolve.conf, and command hostname --fqdn relies on this config 
file to retrieve hostname.

As the VM boots, every time NIC gets activiated, DNS and search domain are 
flushed into resolve.conf as a part of DHCP process. This will give the result 
that the last NIC in boot sequence succeeds in writing these infos. DNS server 
is already set to the one associated with default NIC for all NICs, but search 
domain is not set in the same way. Finally the DNS comes from one vrouter 
associated with default NIC while search domain may come from others.

One quick workaround is adding PEERDNS=no in the network config files for 
non-default NICs on guest VM, this will prevent DHCP client from updating.

To solve this issue, modify DhcpEntryCommand and adding 'domain name' entry in 
dhcpopts.txt can fix this. Not diffcult for coding but needs to test it on 
other guest OS.
                
> Network domain guest suffix is not getting programmed as part of hostnames on 
> Guest VMs that are part of Isolated and Shared Guest Networks
> -------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CLOUDSTACK-107
>                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-107
>             Project: CloudStack
>          Issue Type: Bug
>          Components: Management Server
>    Affects Versions: pre-4.0.0
>            Reporter: Chandan Purushothama
>            Assignee: Mice Xia
>             Fix For: 4.0.0
>
>
> ===========================================================
> Observations on the User VMs present on Isolated and Shared Guest Networks:
> ===========================================================
> **Observe the hostname --fqdn Information on the Guest VMs **
> [root@atoms-regnet-shdnet-vm2 ~]# ip route
> 10.223.137.128/26 dev eth1  proto kernel  scope link  src 10.223.137.133
> 10.1.1.0/24 dev eth0  proto kernel  scope link  src 10.1.1.134
> 169.254.0.0/16 dev eth1  scope link
> default via 10.1.1.1 dev eth0
> [root@atoms-regnet-shdnet-vm2 ~]# ifconfig
> eth0      Link encap:Ethernet  HWaddr 02:00:59:14:00:03
>           inet addr:10.1.1.134  Bcast:10.1.1.255  Mask:255.255.255.0
>           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>           RX packets:8463 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:8676 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:1000
>           RX bytes:7452424 (7.1 MiB)  TX bytes:639913 (624.9 KiB)
> eth1      Link encap:Ethernet  HWaddr 06:F8:3E:00:00:2C
>           inet addr:10.223.137.133  Bcast:10.223.137.191  Mask:255.255.255.192
>           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>           RX packets:16260 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:30005 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:1000
>           RX bytes:1080956 (1.0 MiB)  TX bytes:7215858 (6.8 MiB)
> lo        Link encap:Local Loopback
>           inet addr:127.0.0.1  Mask:255.0.0.0
>           UP LOOPBACK RUNNING  MTU:16436  Metric:1
>           RX packets:87 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:87 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:0
>           RX bytes:12034 (11.7 KiB)  TX bytes:12034 (11.7 KiB)
> [root@atoms-regnet-shdnet-vm2 ~]# ip route
> 10.223.137.128/26 dev eth1  proto kernel  scope link  src 10.223.137.133
> 10.1.1.0/24 dev eth0  proto kernel  scope link  src 10.1.1.134
> 169.254.0.0/16 dev eth1  scope link
> default via 10.1.1.1 dev eth0
> [root@atoms-regnet-shdnet-vm2 ~]# hostname
> atoms-regnet-shdnet-vm2
> [root@atoms-regnet-shdnet-vm2 ~]# hostname --fqdn
> hostname: Unknown host
> [root@atoms-regnet-shdnet-vm2 ~]# cat /etc/hosts
> # Do not remove the following line, or various programs
> # that require network functionality will fail.
> 127.0.0.1               localhost.localdomain localhost
> ::1             localhost6.localdomain6 localhost6
> [root@atoms-regnet-shdnet-vm2 ~]# exit
> logout
> Connection to 10.223.137.133 closed.
> [root@atoms-shdnet-regnet-vm3 ~]#
> [root@atoms-shdnet-regnet-vm3 ~]#
> [root@atoms-shdnet-regnet-vm3 ~]#
> [root@atoms-shdnet-regnet-vm3 ~]# ifconfig
> eth0      Link encap:Ethernet  HWaddr 06:15:2E:00:00:2A
>           inet addr:10.223.137.131  Bcast:10.223.137.191  Mask:255.255.255.192
>           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>           RX packets:49444 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:35070 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:1000
>           RX bytes:15282991 (14.5 MiB)  TX bytes:6945191 (6.6 MiB)
> eth1      Link encap:Ethernet  HWaddr 02:00:1B:9C:00:04
>           inet addr:10.1.1.175  Bcast:10.1.1.255  Mask:255.255.255.0
>           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>           RX packets:129 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:1000
>           RX bytes:6119 (5.9 KiB)  TX bytes:768 (768.0 b)
> lo        Link encap:Local Loopback
>           inet addr:127.0.0.1  Mask:255.0.0.0
>           UP LOOPBACK RUNNING  MTU:16436  Metric:1
>           RX packets:83 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:83 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:0
>           RX bytes:11602 (11.3 KiB)  TX bytes:11602 (11.3 KiB)
> [root@atoms-shdnet-regnet-vm3 ~]# ip route
> 10.223.137.128/26 dev eth0  proto kernel  scope link  src 10.223.137.131
> 10.1.1.0/24 dev eth1  proto kernel  scope link  src 10.1.1.175
> 169.254.0.0/16 dev eth1  scope link
> default via 10.223.137.129 dev eth0
> [root@atoms-shdnet-regnet-vm3 ~]# hostname
> atoms-shdnet-regnet-vm3
> [root@atoms-shdnet-regnet-vm3 ~]# hostname --fqdn
> hostname: Unknown host
> [root@atoms-shdnet-regnet-vm3 ~]#
> =========================================
> Database Information pertaining to the Guest Networks:
> =========================================
> mysql> select * from networks where id in (204,205) \G
> *************************** 1. row ***************************
>                    id: 204
>                  name: TestNetwork-atoms
>                  uuid: 6ebeed0b-7de9-4d7c-a00e-03b6ec134bd9
>          display_text: TestNetwork-atoms
>          traffic_type: Guest
> broadcast_domain_type: Vlan
>         broadcast_uri: vlan://2485
>               gateway: 10.1.1.1
>                  cidr: 10.1.1.0/24
>                  mode: Dhcp
>   network_offering_id: 8
>   physical_network_id: 200
>        data_center_id: 1
>             guru_name: ExternalGuestNetworkGuru
>                 state: Implemented
>               related: 204
>             domain_id: 1
>            account_id: 3
>                  dns1: NULL
>                  dns2: NULL
>             guru_data: NULL
>            set_fields: 0
>              acl_type: Account
>        network_domain: atoms.lab.vmops.com
>        reservation_id: 90d524f0-6397-4ecf-80ba-c9891e0fb551
>            guest_type: Isolated
>      restart_required: 0
>               created: 2012-09-12 00:59:37
>               removed: NULL
>     specify_ip_ranges: 0
>                vpc_id: NULL
> *************************** 2. row ***************************
>                    id: 205
>                  name: SharedNetwork-All
>                  uuid: a06fcc28-4a82-403b-a5c1-63650f89fc96
>          display_text: SharedNetwork-All
>          traffic_type: Guest
> broadcast_domain_type: Vlan
>         broadcast_uri: vlan://1372
>               gateway: 10.223.137.129
>                  cidr: 10.223.137.128/26
>                  mode: Dhcp
>   network_offering_id: 7
>   physical_network_id: 200
>        data_center_id: 1
>             guru_name: DirectNetworkGuru
>                 state: Setup
>               related: 205
>             domain_id: 1
>            account_id: 1
>                  dns1: NULL
>                  dns2: NULL
>             guru_data: NULL
>            set_fields: 0
>              acl_type: Domain
>        network_domain: shdntwkall1.lab.vmops.com
>        reservation_id: NULL
>            guest_type: Shared
>      restart_required: 0
>               created: 2012-09-12 21:45:58
>               removed: NULL
>     specify_ip_ranges: 1
>                vpc_id: NULL
> 2 rows in set (0.00 sec)
> mysql>
> ==========================================================================
> On a VM present on Regular Isolated Network alone, which is created from 
> DefaultNetworkOfferingWithSourceNATServiceEnabled, the hostname has the guest 
> domain suffix as expected:
> ==========================================================================
> [root@atoms-regnet-vm1 ~]# ifconfig
> eth0      Link encap:Ethernet  HWaddr 02:00:46:34:00:01  
>           inet addr:10.1.1.41  Bcast:10.1.1.255  Mask:255.255.255.0
>           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>           RX packets:11721 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:11697 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:1000 
>           RX bytes:8753984 (8.3 MiB)  TX bytes:842033 (822.2 KiB)
> lo        Link encap:Local Loopback  
>           inet addr:127.0.0.1  Mask:255.0.0.0
>           UP LOOPBACK RUNNING  MTU:16436  Metric:1
>           RX packets:112 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:112 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:0 
>           RX bytes:16119 (15.7 KiB)  TX bytes:16119 (15.7 KiB)
> [root@atoms-regnet-vm1 ~]# 
>  [root@atoms-regnet-vm1 ~]# hostname --fqdn
> atoms-regnet-vm1.atoms.lab.vmops.com
> [root@atoms-regnet-vm1 ~]# cat /etc/hosts
> # Do not remove the following line, or various programs
> # that require network functionality will fail.
> 127.0.0.1localhost.localdomain localhost
> ::1localhost6.localdomain6 localhost6
> [root@atoms-regnet-vm1 ~]# ip route
> 10.1.1.0/24 dev eth0  proto kernel  scope link  src 10.1.1.41 
> 169.254.0.0/16 dev eth0  scope link 
> default via 10.1.1.1 dev eth0 
> [root@atoms-regnet-vm1 ~]#
> =======
> Git Info:
> =======
> Git Revision: 03df2fa9dd45c938f72cd1866044b09d1b0cc978
> Git URL: https://git-wip-us.apache.org/repos/asf/incubator-cloudstack.git

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to