You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cloudstack.apache.org by "Alexander Conn (JIRA)" <ji...@apache.org> on 2018/02/07 23:42:00 UTC

[jira] [Commented] (CLOUDSTACK-10167) New VR after network restart with cleanup is missing DNS and DHCP entries

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

Alexander Conn commented on CLOUDSTACK-10167:
---------------------------------------------

For those that need a fix without having to upgrade. I've made a python script in the system vm that runs at startup after the VPC gets recreated and cleaned up. Key thing in this script is wait until /etc/cloudstack/dhcpentry.json is present as it can take a moment for that file to get copied to the VR after clean up. Which is probably part of this bug. Python script below:

 

import json

import pprint

import subprocess

import os

import time

 

dhcp_datafile = '/etc/cloudstack/dhcpentry.json'

while True:

        if os.path.exists(dhcp_datafile):

                break

        else:

                time.sleep(5)

 

dhcp_entries = json.load(open(dhcp_datafile))

 

for dhcp_entry in dhcp_entries.items():

        dhcp_object = json.dumps(dhcp_entry)

        dhcp_data = dhcp_object.split('{')

        dhcp_data2 = dhcp_data[1]

        new_dhcpobject = "{" + dhcp_data2[:-1]

        f = open('/var/cache/cloud/vm_dhcp_entry.json','w')

        f.write(new_dhcpobject)

        f.close() 

        subprocess.call(['/usr/bin/python','/opt/cloud/bin/update_config.py','vm_dhcp_entry.json'], shell=False)

> New VR after network restart with cleanup is missing DNS and DHCP entries
> -------------------------------------------------------------------------
>
>                 Key: CLOUDSTACK-10167
>                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10167
>             Project: CloudStack
>          Issue Type: Bug
>      Security Level: Public(Anyone can view this level - this is the default.) 
>    Affects Versions: 4.9.2.0, 4.9.1.0, 4.9.0.1, 4.9.3.0
>         Environment: * CloudStack 4.9.3 / CentOS7
> * CloudStack 4.9.2 / CentOS7
> * CloudStack 4.9.1 / CentOS7
> * CloudStack 4.9.0.1 / CentOS7
> * KVM / 4.9.1 + 4.9.2 + 4.9.3 + 4.10.0 / CentOS7
> * XenServer 6.5 SP1
> * VMware vSphere 6.5
> * Issue observed on isolated and shared networks
> * 4.6 "new" system VM templates: http://packages.shapeblue.com/systemvmtemplate/4.6/new/
>            Reporter: Dag Sonstebo
>            Priority: Major
>
> Note: problem seems to be only in 4.9.x, seems fixed in 4.10.
> Environment:
> * CloudStack 4.9.3 / CentOS7
> * CloudStack 4.9.2 / CentOS7
> * CloudStack 4.9.1 / CentOS7
> * CloudStack 4.10.0 / CentOS7
> * Tested and reproduced with:
> ** KVM / 4.9.1+4.9.2+4.9.3 / CentOS7
> ** XenServer 6.5 SP1
> ** VMware vSphere 6.5
> * Issue observed on isolated and shared networks
> * 4.6 "new" system VM templates: http://packages.shapeblue.com/systemvmtemplate/4.6/new/
> Steps to reproduce:
> * Create isolated or shared network with running VM
> * Confirm that everything works OK - DNS resolution and DHCP.
> * Restart network with cleanup.
> * On new VR check DNS and DHCP settings.
> * Result:
> ** /etc/dnsmasq.d/cloud.conf: file is missing, hence no base DHCP config
> ** /etc/hosts: file present but missing all user VM entries, hence no DNS resolution
> ** /etc/dhcphosts.txt: file is missing, hence no DHCP 
> ** /etc/cloudstack/dhcpentry.json: file is present and contains expected JSON VM entries 
> As a result the new VR:
> * Will not hand out DHCP entries
> * Will not do name resolution
> Workaround:
> * Creating new VM or stopping and starting a VM restores all settings.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)