Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Example Analysis of OpenStack Nova scheduling Service Learning and its filter programming

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

This article will explain in detail the sample analysis of OpenStack Nova scheduling service learning and its filter compilation. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.

Preliminary analysis shows related processes $ps-aux | grep nova | awk'{for (iTun11) ITun11 {print ""}'/ usr/bin/python / usr/bin/nova-compute-- config-file=/etc/nova/nova.conf-- config-file=/etc/nova/nova-compute.conf-- log-file=/var/log/nova/nova-compute.log / usr/bin/python / usr/bin/nova-api-- config-file=/etc/nova/nova.conf-- log-file=/var/log/nova/nova-api.log / usr/bin/python / usr/bin / nova-conductor-config-file=/etc/nova/nova.conf-log-file=/var/log/nova/nova-conductor.log / usr/bin/python / usr/bin/nova-scheduler-config-file=/etc/nova/nova.conf-log-file=/var/log/nova/nova-scheduler.log / usr/bin/python / usr/bin/nova-consoleauth-config-file=/etc/nova/nova.conf-log-file=/var/log/nova/nova-consoleauth .log / usr/bin/python / usr/bin/nova-novncproxy-config-file=/etc/nova/nova.conf-log-file=/var/log/nova/nova-novncproxy.log / usr/bin/python / usr/bin/nova-conductor-config-file=/etc/nova/nova.conf-log-file=/var/log/nova/nova-conductor.log / usr/bin/python / usr/bin/nova-conductor-config-file=/etc/nova/nova.conf-log -file=/var/log/nova/nova-conductor.log / usr/bin/python / usr/bin/nova-api-config-file=/etc/nova/nova.conf-- log-file=/var/log/nova/nova-api.log / usr/bin/python / usr/bin/nova-api-- config-file=/etc/nova/nova.conf-- log-file=/var/log/nova/nova-api.log / usr/bin/python / usr/bin/nova-api-- config- File=/etc/nova/nova.conf-log-file=/var/log/nova/nova-api.log / usr/bin/python / usr/bin/nova-api-config-file=/etc/nova/nova.conf-log-file=/var/log/nova/nova-api.log / usr/bin/python2.7 / usr/bin/privsep-helper-config-file / etc/nova/nova.conf-config-file / etc/nova/nova-compute.conf-privsep_context vif _ plug_linux_bridge.privsep.vif_plug-- privsep_sock_path / tmp/tmpZtOLbU/privsep.sock / usr/bin/python2.7 / usr/bin/privsep-helper-- config-file / etc/nova/nova.conf-- config-file / etc/nova/nova-compute.conf-- privsep_context os_brick.privileged.default-- privsep_sock_path / tmp/tmpjXCHkt/privsep.sock pluma / usr/lib/python2.7/dist-packages/nova/scheduler/filters/retry_filter.py View related services

View all Nova services:

$systemctl list-units | grep nova nova-api.service loaded active running OpenStack Compute API nova-compute.service loaded active running OpenStack Compute nova-conductor.service loaded active running OpenStack Compute Conductor nova-consoleauth.service loaded active running OpenStack Compute Console nova-novncproxy.service Loaded active running OpenStack Compute novncproxy nova-scheduler.service loaded active running OpenStack Compute Scheduler

View the software package to which the service belongs:

$apt-get install apt-file$ apt-file update$ apt-file search / lib/systemd/system/nova-api.servicenova-api: / lib/systemd/system/nova-api.service$ apt-file search / lib/systemd/system/nova-compute.servicenova-compute: / lib/systemd/system/nova-compute.service$ apt-file search / lib/systemd/system/nova-conductor.servicenova-conductor: / lib/systemd/system/nova-conductor.service$ apt-file search / lib/systemd/system/nova -consoleauth.servicenova-consoleauth: / lib/systemd/system/nova-consoleauth.service$ apt-file search / lib/systemd/system/nova-novncproxy.servicenova-novncproxy: / lib/systemd/system/nova-novncproxy.service$ apt-file search / lib/systemd/system/nova-scheduler.servicenova-scheduler: / lib/systemd/system/nova-scheduler.service

View the Nova Scheduler service status:

$systemctl status nova-scheduler.service ● nova-scheduler.service-OpenStack Compute Scheduler Loaded: loaded (/ lib/systemd/system/nova-scheduler.service; enabled; vendor preset: enabled) Active: active (running) since three 2017-12-06 23:23:39 CST 10h ago Process: 3150 ExecStartPre=/bin/chown nova:adm / var/log/nova (code=exited, status=0/SUCCESS) Process: 3076 ExecStartPre=/bin/chown nova:nova / var/lock/nova / var/lib/nova (code=exited, status=0/SUCCESS) Process: 3016 ExecStartPre=/bin/mkdir-p / var/lock/nova / var/log/nova / var/lib/nova (code=exited Status=0/SUCCESS) Main PID: 3241 (nova-scheduler) CGroup: / system.slice/nova-scheduler.service └─ 3241 / usr/bin/python / usr/bin/nova-scheduler-- config-file=/etc/nova/nova.conf-- log-file=/var/log/nova/nova-scheduler.12 07 09:59:13 UbuntuStack nova-scheduler [3241]: 2017-12-07 09PUBG 59 nova-scheduler 13.690 3241 INFO nova.scheduler.host_manager [req-27631738-6333Muir.

View the Nova Scheduler service configuration script:

$cat / lib/systemd/system/nova- organizer. Service [Unit] Description=OpenStack Compute SchedulerAfter=postgresql.service mysql.service keystone.service [Service] User=novaGroup=novaType=simpleWorkingDirectory=/var/lib/novaPermissionsStartOnly=trueExecStartPre=/bin/mkdir-p / var/lock/nova / var/log/nova / var/lib/novaExecStartPre=/bin/chown nova:nova / var/lock/nova / var/lib/novaExecStartPre=/bin/chown nova:adm / var/log/novaExecStart=/etc/init.d/nova-scheduler systemd-startRestart=on-failureLimitNOFILE=65535TimeoutStopSec=15 [Install] WantedBy=multi-user.target

View the Nove Scheduler service init script:

$cat / EtcUnip init.dAccording to Nova Short-Description Short-Description: postgresql mysql keystone# Default-Start Short-Description: Nova Scheduler# Description: Schedules instances, volumes: $BEGIN INIT INFO# Provides: nova-scheduler# Required-Start: $network $local_fs $remote_fs $syslog# Required-Stop: $remote_fs# Should-Start: postgresql mysql keystone# Should-Stop: postgresql mysql keystone# Default-Start: 2 34 'Short-Description: Nova Scheduler# Description: Schedules instances, volumes Etc. For Nova### END INIT INFO# Author: Julien Danjou DESC= "OpenStack Compute Scheduler" PROJECT_NAME=novaNAME=nova-scheduler...if [- z "${DAEMON}"] Then DAEMON=/usr/bin/$ {NAME} fi...if [- z "${NO_OPENSTACK_CONFIG_FILE_DAEMON_ARG}"]; then DAEMON_ARGS= "--config-file=$ {CONFIG_FILE} ${DAEMON_ARGS}" fi...do_systemd_start () {exec $DAEMON $DAEMON_ARGS}... systemd-start) do_systemd_start;;... exit 0

View the Nova Scheduler startup script:

$cat / usr main__ _ PBR Generated from u'console_scripts'import sysfrom nova.cmd.scheduler import mainif _ _ name__ = = "_ _ main__": sys.exit (main ()) to view the package information

View the status of Nova-related software packages in the system:

$dpkg-l "* nova*" expected status = unknown (u) / install (I) / remove (r) / clear (p) / hold (h) | status = not installed / installed / only configuration (c) / decompressed only (U) / configuration failed (F) / incomplete installation (H) / trigger wait (W) / trigger pending (T) | / error? = (none) ) / need to reinstall (R) (status) Error: uppercase = fault) | | / name version architecture: description + +-= = ii nova-api 2API frontendhi nova-common 14.0.1-0ubuntu1 all OpenStack Compute-API frontendhi nova-common 2API frontendhi nova-common 14.0.1-0ubuntu1 all OpenStack Compute-common filesii nova -compute 2compute node baseun nova-compute-hypervisor 14.0.1-0ubuntu1 all OpenStack Compute-compute node baseun nova-compute-hypervisor (no description available) ii nova-compute-kvm 2compute node baseun nova-compute-hypervisor 14.0.1-0ubuntu1 all OpenStack Compute-compute node (KVM) ii nova-compute-libvirt 2compute node baseun nova-compute-hypervisor 14.0.1-0ubuntu1 all OpenStack Compute -compute node libvirt supportii nova-conductor 2conductor serviceun nova-console 14.0.1-0ubuntu1 all OpenStack Compute-conductor serviceun nova-console (no description available) ii nova-consoleauth 2conductor serviceun nova-console 14.0.1-0ubuntu1 all OpenStack Compute-Console Authenticatorii nova-novncproxy 2conductor serviceun nova-console 14.0.1-0ubuntu1 all OpenStack Compute-NoVNC proxyii nova-scheduler 2vl 14.0.1-0ubuntu1 all OpenStack Compute-virtual machine schedulerhi python-nova 2VR 14.0.1-0ubuntu1 all OpenStack Compute Python librariesii python-novaclient 2Rod 6.0.0-0ubuntu 1 ~ all client library for OpenStack Compute API-Python 2.7un python2.7-nova (no description available)

Check the software package to which the Python source code of Nova belongs:

$apt-file search / usr/lib/python2.7/dist-packages/nova* | awk-F'/'{print $1 $6}'| sort-upython-nova-adminclient: nova_adminclientpython-nova-adminclient: nova_adminclient-0.1.8.egg-infopython-novaclient: novaclientpython-nova-lxd: novapython-nova-lxd: nova_lxdpython-nova-lxd: nova_lxd-13.0.0.egg-infopython-nova-lxd: nova_lxd-13.0.0-nspkg.pthpython- Nova-lxd: nova_lxd-13.2.0.egg-infopython-nova-lxd: nova_lxd-13.2.0-nspkg.pthpython-nova-lxd: nova_lxd-13.3.0.egg-infopython-nova-lxd: nova_lxd-13.3.0-nspkg.pthpython-nova-lxd: nova_lxd-14.2.2.egg-infopython-nova: novapython-nova: nova-13.0.0.egg-infopython-nova: nova-13.1.4.egg- Infopython-nova: nova-14.0.8.egg-info

View a list of nova-scheduler package dependencies and files:

$apt-cache show nova-schedulerPackage: nova-schedulerSource: novaPriority: extraSection: netInstalled-Size: 56Maintainer: Ubuntu Developers Architecture: allVersion: 2VV 14.0.8-0ubuntu1~cloud1Depends: nova-common (= 2RV 14.0.8-0ubuntu1~cloud1), init-system-helpers (> = 1.18 ~), lsb-base (> = 4.1+Debian11ubuntu7) Python:any (> = 2.7) Supported: 24mFilename: pool/main/n/nova/nova-scheduler_14.0.8-0ubuntu1~cloud1_all.debSize: 6460SHA256: 133a23ea0ab69e08716e117aa5881c7840d0431c29fc0cba9fd7146180460965SHA1: 41649a1311faa52fe539a293670dd58a79fd200bMD5sum: bc448ccba9626103924c086c30012d7eDescription-en: OpenStack Compute-virtual machine scheduler OpenStack is a reliable cloud infrastructure. Its mission is to produce the ubiquitous cloud computing platform that will meet the needs of public and private cloud providers regardless of size, by being simple to implement and massively scalable. . OpenStack Compute, codenamed Nova, is a cloud computing fabric controller. In addition to its "native" API (the OpenStack API), it also supports the Amazon EC2 API. . Nova is intended to be modular and easy to extend and adapt. It supports many different hypervisors (KVM and Xen to name a few), different database backends (SQLite, MySQL, and PostgreSQL, for instance), different types of user databases (LDAP or SQL), etc. This is the Nova scheduler.Description-md5: 8edec11a409c894d59bffef4d16d21b6Original-Maintainer: Openstack Maintainers... $dpkg-L nova-scheduler/./usr/usr/bin/usr/bin/nova-scheduler/usr/share/usr/share/man/usr/share/man/man1/usr/share/man/man1/nova-scheduler.1.gz/usr/share/doc/usr/share/doc/nova-scheduler/usr/share/doc/nova-scheduler/copyright/etc/etc/init.d/etc/init.d/nova -scheduler/etc/init/etc/init/nova-scheduler.conf/lib/lib/systemd/lib/systemd/system/lib/systemd/system/nova-scheduler.service/usr/share/doc/nova-scheduler/changelog.Debian.gz

View a list of nova-common package dependencies and files:

$apt-cache show nova-commonPackage: nova-commonSource: novaPriority: extraSection: netInstalled-Size: 79Maintainer: Ubuntu Developers Architecture: allVersion: 2netInstalled-Size 14.0.8-0ubuntu1~cloud1Recommends: python-glanceclient, python-keystoneDepends: adduser, python-nova (= 2netInstalled-Size 14.0.8-0ubuntu1~cloud1) Python:any (> = 2.7 ~) Supported: 24mFilename: pool/main/n/nova/nova-common_14.0.8-0ubuntu1cloud1roomall.deb.$ dpkg-L nova-common/./usr/usr/bin/usr/bin/nova-rootwrap/usr/bin/nova-policy/usr/bin/nova-rootwrap-daemon/usr/bin/nova-manage/usr/share/usr/share/man/usr/share/man/man1/usr/share/man/man1/nova-rootwrap.1 .gz / usr/share/man/man1/nova-manage.1.gz/usr/share/doc/usr/share/doc/nova-common/usr/share/doc/nova-common/copyright/etc/etc/nova/etc/nova/policy.json/etc/nova/api-paste.ini/etc/nova/nova.conf/etc/nova/rootwrap.d/etc/nova/rootwrap.conf/etc/nova/logging.conf/etc/logrotate.d/etc/logrotate.d/nova-common/etc / sudoers.d/etc/sudoers.d/nova_sudoers/var/var/log/var/log/nova/var/lib/var/lib/nova/var/lib/nova/CA/var/lib/nova/CA/INTER/var/lib/nova/CA/private/var/lib/nova/CA/newcerts/var/lib/nova/CA/reqs/var/lib/nova/instances/var/lib/nova/buckets/var/lib/nova/keys/var/lib/nova/tmp/var/lib / nova/images/var/lib/nova/networks/usr/share/doc/nova-common/changelog.Debian.gz

View a list of python-nova package dependencies and files:

$apt-cache show python-novaPackage: python-novaSource: novaPriority: extraSection: pythonInstalled-Size: 22286Maintainer: Ubuntu Developers Architecture: allVersion: 2Vatio 14.0.8-0ubuntu1~cloud1Suggests: python-ldapProvides: python2.7-novaDepends: alembic (> = 0.8.0), openssh-client, openssl, python-babel (> = 2.3.4), python-boto (> = 2.32.1), python-castellan (> = 0.4.0), python-cinderclient (> = 1.6.0), python-cryptography (> = 1.0) Python-decorator, python-eventlet, python-glanceclient, python-greenlet, python-iso8601, python-jinja2, python-jsonschema, python-keystoneauth2, python-keystonemiddleware, python-lxml, python-microversion-parse Python-migrate, python-netaddr, python-netifaces, python-neutronclient, python-os-brick, python-os-vif, python-os-win, python-oslo.cache, python-oslo.concurrency Python-oslo.config (> = 1python-oslo.config 3.10.0), python-oslo.context (> = 2.4.0), python-oslo.db (> = 4.1.0), python-oslo.i18n (> = 2.1.0), python-oslo.log (> = 3.16.0), python-oslo.messaging (> = 5.2.0), python-oslo.middleware (> = 3.0.0), python-oslo.policy (> = 1.9.0), python-oslo.privsep (> = 1.9.0) Python-oslo.reports (> = 0.6), python-oslo.rootwrap (> = 2.0.0), python-oslo.serialization (> = 1.10.0), python-oslo.service (> = 1.10.0), python-oslo.utils (> = 3.11.0), python-oslo.versionedobjects (> = 1.9.1), python-paramiko (> = 1.16.0), python-paste, python-pastedeploy (> = 1.5.0), python-prettytable (> = 0.7) Python-psutil (> = 1.1.1), python-pymysql, python-requests (> = 2.10.0), python-rfc3986 (> = 0.2.2), python-routes (> 1.12.3), python-setuptools (> = 16.0), python-six (> = 1.9.0), python-sqlalchemy (> = 1.0.10), python-stevedore (> = 1.10.0), python-webob (> = 1.2.3), python-pbr, python-pkg-resources, python-sqlalchemy

< 1.1), python:any (< 2.8), python:any (>

< min_count: raise exception.PortLimitExceeded() elif max_net_count < max_count: LOG.info(_LI("max count reduced from %(max_count)d to " "%(max_net_count)d due to network port quota"), {'max_count': max_count, 'max_net_count': max_net_count}) max_count = max_net_count block_device_mapping = self._check_and_transform_bdm(context, base_options, instance_type, boot_meta, min_count, max_count, block_device_mapping, legacy_bdm) # We can't do this check earlier because we need bdms from all sources # to have been merged in order to get the root bdm. self._checks_for_create_and_rebuild(context, image_id, boot_meta, instance_type, metadata, injected_files, block_device_mapping.root_bdm()) instance_group = self._get_requested_instance_group(context, filter_properties) instances = self._provision_instances(context, instance_type, min_count, max_count, base_options, boot_meta, security_groups, block_device_mapping, shutdown_terminate, instance_group, check_server_group_quota, filter_properties, key_pair) for instance in instances: self._record_action_start(context, instance, instance_actions.CREATE) self.compute_task_api.build_instances(context, instances=instances, image=boot_meta, filter_properties=filter_properties, admin_password=admin_password, injected_files=injected_files, requested_networks=requested_networks, security_groups=security_groups, block_device_mapping=block_device_mapping, legacy_bdm=False) return (instances, reservation_id)...构建基本的参数选项 (compute/api.py) ... def _validate_and_build_base_options(self, context, instance_type, boot_meta, image_href, image_id, kernel_id, ramdisk_id, display_name, display_description, key_name, key_data, security_groups, availability_zone, user_data, metadata, access_ip_v4, access_ip_v6, requested_networks, config_drive, auto_disk_config, reservation_id, max_count): """Verify all the input parameters regardless of the provisioning strategy being performed. """ if instance_type['disabled']: raise exception.FlavorNotFound(flavor_id=instance_type['id']) if user_data: l = len(user_data) if l >

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report