[
https://issues.apache.org/jira/browse/CLOUDSTACK-9042?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15013391#comment-15013391
]
ASF GitHub Bot commented on CLOUDSTACK-9042:
--------------------------------------------
Github user resmo commented on the pull request:
https://github.com/apache/cloudstack/pull/1045#issuecomment-158030442
Our test case on ACS 4.5.1:
# Before fix
## vanilla router deployed:
~~~
# related script
ae693b5ef2d9b1fed1307f6b38213823 /opt/cloud/bin/edithosts.sh
# see running VMs
$ cloudstack-cli server list --project stxt_integration --zone BIEL_CU01
--state running
Name Instance-Name State Offering Zone Project
IP's
web-eq-03 i-70-5871-VM Running 2cpu_2gb BIEL_CU01
STXT_INTEGRATION 10.101.65.183 10.101.192.50 10.101.128.50
web-eq-01 i-70-5870-VM Running 2cpu_2gb BIEL_CU01
STXT_INTEGRATION 10.101.65.69 10.101.192.49 10.101.128.49
jumphost-eq-01 i-70-5874-VM Running 1cpu_1gb BIEL_CU01
STXT_INTEGRATION 10.101.65.113 10.101.192.52 10.101.128.52
# hosts on router (note vm eq-01 is stopped)
root@r-6215-VM:~# cat /etc/hosts
127.0.0.1 localhost
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
10.101.65.1 r-6215-VM
10.101.65.176 eb-eq-04
10.101.65.1 r-6215-VM
10.101.65.1 r-6215-VM
10.101.65.1 r-6215-VM
10.101.65.1 r-6215-VM
10.101.65.85 eq-01
10.101.65.1 r-6215-VM
10.101.65.1 data-server
10.101.65.1 r-6215-VM
10.101.65.69 web-eq-01
10.101.65.183 web-eq-03
10.101.65.113 jumphost-eq-01
# dhcp hosts no problems as eq-01 entry was made before others *eq-01
entries.
root@r-6215-VM:~# cat /etc/dhcphosts.txt
02:00:11:bb:03:53,set:10_101_65_176,10.101.65.176,eb-eq-04,infinite
02:00:6e:44:03:58,set:10_101_65_85,10.101.65.85,eq-01,infinite
02:00:4f:6d:03:4b,set:10_101_65_69,10.101.65.69,web-eq-01,infinite
02:00:6f:94:03:4c,set:10_101_65_183,10.101.65.183,web-eq-03,infinite
02:00:7a:76:03:4e,set:10_101_65_113,10.101.65.113,jumphost-eq-01,infinite
~~~
## start a VM named eq-01
~~~
############# start a VM named eq-01
$ cloudstack-cli server list --project stxt_integration --zone BIEL_CU01
--state running
Name Instance-Name State Offering Zone Project
IP's
web-eq-03 i-70-5871-VM Running 2cpu_2gb BIEL_CU01
STXT_INTEGRATION 10.101.65.183 10.101.192.50 10.101.128.50
web-eq-01 i-70-5870-VM Running 2cpu_2gb BIEL_CU01
STXT_INTEGRATION 10.101.65.69 10.101.192.49 10.101.128.49
eq-01 i-70-6216-VM Running 1cpu_1gb BIEL_CU01
STXT_INTEGRATION 10.101.65.85 10.101.192.76 10.101.128.76
jumphost-eq-01 i-70-5874-VM Running 1cpu_1gb BIEL_CU01
STXT_INTEGRATION 10.101.65.113 10.101.192.52 10.101.128.52
# hosts still looks "good"
root@r-6215-VM:~# cat /etc/hosts
127.0.0.1 localhost
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
10.101.65.1 r-6215-VM
10.101.65.176 eb-eq-04
10.101.65.1 r-6215-VM
10.101.65.1 r-6215-VM
10.101.65.1 r-6215-VM
10.101.65.1 data-server
10.101.65.1 r-6215-VM
10.101.65.69 web-eq-01
10.101.65.183 web-eq-03
10.101.65.113 jumphost-eq-01
10.101.65.85 eq-01
# dhcp entries *eq-01 where removed... BAD!!!
root@r-6215-VM:~# cat /etc/dhcphosts.txt
02:00:11:bb:03:53,set:10_101_65_176,10.101.65.176,eb-eq-04,infinite
02:00:6f:94:03:4c,set:10_101_65_183,10.101.65.183,web-eq-03,infinite
02:00:6e:44:03:58,set:10_101_65_85,10.101.65.85,eq-01,infinite
~~~
# With fix applied!
## Reset test env: stop VM eq-01, apply fix, restart router
~~~
############### stop VM eq-01, apply fix, restart router
root@r-6215-VM:~# md5sum /opt/cloud/bin/edithosts.sh
a610c2dfb0248e6a74993d6452e14244 /opt/cloud/bin/edithosts.sh
# everything looks fine after reset again (just because eq-01 came earlier
then *eq-01)
root@r-6215-VM:~# cat /etc/dhcphosts.txt
02:00:11:bb:03:53,set:10_101_65_176,10.101.65.176,eb-eq-04,infinite
02:00:6e:44:03:58,set:10_101_65_85,10.101.65.85,eq-01,infinite
02:00:4f:6d:03:4b,set:10_101_65_69,10.101.65.69,web-eq-01,infinite
02:00:6f:94:03:4c,set:10_101_65_183,10.101.65.183,web-eq-03,infinite
02:00:7a:76:03:4e,set:10_101_65_113,10.101.65.113,jumphost-eq-01,infinite
root@r-6215-VM:~# cat /etc/hosts
127.0.0.1 localhost
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
10.101.65.1 r-6215-VM
10.101.65.176 eb-eq-04
10.101.65.1 r-6215-VM
10.101.65.1 r-6215-VM
10.101.65.1 r-6215-VM
10.101.65.1 r-6215-VM
10.101.65.85 eq-01
10.101.65.1 r-6215-VM
10.101.65.1 data-server
10.101.65.1 r-6215-VM
10.101.65.69 web-eq-01
10.101.65.183 web-eq-03
10.101.65.113 jumphost-eq-01
~~~
## start VM eq-01
~~~
#### start VM eq-01
# hosts still look good here after the fix
root@r-6215-VM:~# cat /etc/hosts
127.0.0.1 localhost
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
10.101.65.1 r-6215-VM
10.101.65.176 eb-eq-04
10.101.65.1 r-6215-VM
10.101.65.1 r-6215-VM
10.101.65.1 r-6215-VM
10.101.65.1 r-6215-VM
10.101.65.1 r-6215-VM
10.101.65.1 data-server
10.101.65.1 r-6215-VM
10.101.65.69 web-eq-01
10.101.65.183 web-eq-03
10.101.65.113 jumphost-eq-01
10.101.65.85 eq-01
# /etc/dhcphosts looks as it should!
root@r-6215-VM:~# cat /etc/dhcphosts.txt
02:00:11:bb:03:53,set:10_101_65_176,10.101.65.176,eb-eq-04,infinite
02:00:4f:6d:03:4b,set:10_101_65_69,10.101.65.69,web-eq-01,infinite
02:00:6f:94:03:4c,set:10_101_65_183,10.101.65.183,web-eq-03,infinite
02:00:7a:76:03:4e,set:10_101_65_113,10.101.65.113,jumphost-eq-01,infinite
02:00:6e:44:03:58,set:10_101_65_85,10.101.65.85,eq-01,infinite
~~~
> VR: Missing dhcp entries in /etc/dhpchosts.txt after starting a few VMs
> -----------------------------------------------------------------------
>
> Key: CLOUDSTACK-9042
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9042
> Project: CloudStack
> Issue Type: Bug
> Security Level: Public(Anyone can view this level - this is the
> default.)
> Components: Virtual Router
> Affects Versions: 4.4.4, 4.5.2
> Reporter: René Moser
> Assignee: René Moser
> Priority: Critical
> Fix For: 4.4.5, 4.5.3
>
>
> VR advanced networking.
> We experienced an issue when a few VMs were started at a time, some of them
> and always the same ones did not receive a IP from DHCP.
> After a debuging, we identified the problem in this sed command in
> ./systemvm/patches/debian/config/opt/cloud/bin/edithosts.sh
> the VM which was not in /etc/dhcphosts.txt was named:
> songlog-1
> When another VM was started named "log-1" the "songlog-1" entry was removed
> unexpectedly.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)