Reviewed: https://review.openstack.org/301247 Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=95da4e87881424524c8ddda6a546764d43eb755e Submitter: Jenkins Branch: master
commit 95da4e87881424524c8ddda6a546764d43eb755e Author: Sahid Orentino Ferdjaoui <[email protected]> Date: Mon Apr 4 10:24:23 2016 -0400 libvirt: release serial console ports when destroying guests The part of code responsible to release serial ports does not cover all the cases. This commit moves that part inside the method _destroy which is responsible for destroying the guest from a libvirt perspective which is when we want to release ports. Change-Id: I24f2a1fa3b7ef3f2a3196f3689e5f2ba7d49bd87 Closes-Bug: #1489853 ** Changed in: nova Status: In Progress => Fix Released -- You received this bug notification because you are a member of Yahoo! Engineering Team, which is subscribed to OpenStack Compute (nova). https://bugs.launchpad.net/bugs/1489853 Title: when hard-reboot a instance with serial-port multiple times, instance will not start for port exhausted Status in OpenStack Compute (nova): Fix Released Status in OpenStack Compute (nova) liberty series: Confirmed Status in OpenStack Compute (nova) mitaka series: Confirmed Bug description: My running environment is openstack-nova-compute-2015.1.0-3.el7.noarch python-nova-2015.1.0-3.el7.noarch openstack-nova-novncproxy-2015.1.0-3.el7.noarch openstack-nova-conductor-2015.1.0-3.el7.noarch openstack-nova-api-2015.1.0-3.el7.noarch openstack-nova-console-2015.1.0-3.el7.noarch openstack-nova-scheduler-2015.1.0-3.el7.noarch openstack-nova-serialproxy-2015.1.0-3.el7.noarch openstack-nova-common-2015.1.0-3.el7.noarch In my nova.conf ,port_range=20000:20020 I boot a instance with two serial-port ,it works well. When i hard reboot this instance muti-times,it can't start and its status is shut-off The log is below : 2015-08-28 17:06:46.635 7258 TRACE oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/nova/virt/libvirt/d river.py", line 3830, in _create_serial_console_devices 2015-08-28 17:06:46.635 7258 TRACE oslo_messaging.rpc.dispatcher console.listen_host)) 2015-08-28 17:06:46.635 7258 TRACE oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/oslo_concurrency/lo ckutils.py", line 445, in inner 2015-08-28 17:06:46.635 7258 TRACE oslo_messaging.rpc.dispatcher return f(*args, **kwargs) 2015-08-28 17:06:46.635 7258 TRACE oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/nova/console/serial .py", line 82, in acquire_port 2015-08-28 17:06:46.635 7258 TRACE oslo_messaging.rpc.dispatcher raise exception.SocketPortRangeExhaustedException(host=h ost) after check code,i thought the hard-reboot code process has some problem。 The function release_port() is only in function cleanup() When a instance is deleted ,function cleanup() is called But when a instance is hard-boot,in _hard_reboot function it only call _destroy(). and then it call _get_guest_xml() and in it acquire_port() function is called. so the instance will always acquire port but not release. at last port will be exhausted in logic I think in _hard_reboot() of libvrit/driver.py,it should be edited below: ..... self._destroy(instance) if CONF.serial_console.enabled: serials = self._get_serial_ports_from_instance(instance) for hostname, port in serials: serial_console.release_port(host=hostname, port=port) .... To manage notifications about this bug go to: https://bugs.launchpad.net/nova/+bug/1489853/+subscriptions -- Mailing list: https://launchpad.net/~yahoo-eng-team Post to : [email protected] Unsubscribe : https://launchpad.net/~yahoo-eng-team More help : https://help.launchpad.net/ListHelp

