Skip to content

Instantly share code, notes, and snippets.

@zhanghui9700
Created January 18, 2018 03:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zhanghui9700/6db5fdd9683dc274ddfc19330d0f3c85 to your computer and use it in GitHub Desktop.
Save zhanghui9700/6db5fdd9683dc274ddfc19330d0f3c85 to your computer and use it in GitHub Desktop.

virt.libvirt.driver.create_domain_and_network

# virt/libvirt/driver.py
def _create_domain_and_network():
    block_device_mapping = driver.block_device_info_get_mapping(
        block_device_info)
    LOG.info("[pykit] block_device_mapping: %s", block_device_mapping)
    LOG.info("[pykit] network_info: %s", network_info)

nova boot from ephemeral disk and network

nova.virt.libvirt.driver [req-903404b2-f395-4470-88e9-6f7e8da03a77 d0e7479f938546e4ae585bb79eb92470 de7a303be15246b99e4d3c80537f7ac4 - - -] [pykit] block_device_mapping: []

nova.virt.libvirt.driver [req-903404b2-f395-4470-88e9-6f7e8da03a77 d0e7479f938546e4ae585bb79eb92470 de7a303be15246b99e4d3c80537f7ac4 - - -] [pykit] network_info: [{"profile": {}, "ovs_interfaceid": "5d5d25c4-7a23-4478-ae5f-d8091304cc81", "preserve_on_delete": false, "network": {"bridge": "br-int", "subnets": [{"ips": [{"meta": {}, "version": 4, "type": "fixed", "floating_ips": [], "address": "192.168.111.10"}], "version": 4, "meta": {"dhcp_server": "192.168.111.2"}, "dns": [{"meta": {}, "version": 4, "type": "dns", "address": "8.8.4.4"}, {"meta": {}, "version": 4, "type": "dns", "address": "8.8.8.8"}], "routes": [], "cidr": "192.168.111.0/24", "gateway": {"meta": {}, "version": 4, "type": "gateway", "address": "192.168.111.1"}}], "meta": {"injected": false, "tenant_id": "de7a303be15246b99e4d3c80537f7ac4", "mtu": 1500}, "id": "cddae4f1-dbbe-4f3e-91df-6af6c83d9a95", "label": "admin_internal_net"}, "devname": "tap5d5d25c4-7a", "vnic_type": "normal", "qbh_params": null, "meta": {}, "details": {"port_filter": true, "ovs_hybrid_plug": true}, "address": "fa:16:3e:a7:3f:07", "active": false, "type": "ovs", "id": "5d5d25c4-7a23-4478-ae5f-d8091304cc81", "qbg_params": null}]

nova boot from volume and network

nova.virt.libvirt.volume.net [req-8d1dd706-bc83-4c7b-8de1-3c6a647a45f2 d0e7479f938546e4ae585bb79eb92470 de7a303be15246b99e4d3c80537f7ac4 - - -] pykit: {u'secret_type': u'ceph', u'name': u'volumes/volume-e5757b87-52c5-4d2a-ac4d-7eb62686f63d', u'encrypted': False, u'cluster_name': u'ceph', u'secret_uuid': u'a5d0dd94-57c4-ae55-ffe0-7e3732a24455', u'qos_specs': None, u'hosts': [u'192.168.12.1'], u'volume_id': u'e5757b87-52c5-4d2a-ac4d-7eb62686f63d', u'auth_enabled': True, u'access_mode': u'rw', u'auth_username': u'volumes', u'ports': [u'6789']} get_config /usr/lib/python2.7/dist-packages/nova/virt/libvirt/volume/net.py:107
nova.virt.libvirt.driver [req-8d1dd706-bc83-4c7b-8de1-3c6a647a45f2 d0e7479f938546e4ae585bb79eb92470 de7a303be15246b99e4d3c80537f7ac4 - - -] [pykit] block_device_mapping: [{'guest_format': None, 'boot_index': 0, 'mount_device': u'/dev/vda', 'connection_info': {u'driver_volume_type': u'rbd', 'connector': {'platform': 'x86_64', 'host': 'node-23.domain.tld', 'do_local_attach': False, 'ip': '192.168.11.3', 'os_type': 'linux2', 'multipath': False, 'initiator': u'iqn.1993-08.org.debian:01:5427a5e3b240'}, 'serial': u'e5757b87-52c5-4d2a-ac4d-7eb62686f63d', u'data': {u'secret_type': u'ceph', u'name': u'volumes/volume-e5757b87-52c5-4d2a-ac4d-7eb62686f63d', u'encrypted': False, u'cluster_name': u'ceph', u'secret_uuid': u'a5d0dd94-57c4-ae55-ffe0-7e3732a24455', u'qos_specs': None, u'hosts': [u'192.168.12.1'], u'volume_id': u'e5757b87-52c5-4d2a-ac4d-7eb62686f63d', u'auth_enabled': True, u'access_mode': u'rw', u'auth_username': u'volumes', u'ports': [u'6789']}}, 'disk_bus': u'virtio', 'device_type': u'disk', 'delete_on_termination': True}]
nova.virt.libvirt.driver [req-8d1dd706-bc83-4c7b-8de1-3c6a647a45f2 d0e7479f938546e4ae585bb79eb92470 de7a303be15246b99e4d3c80537f7ac4 - - -] [pykit] network_info: [{"profile": {}, "ovs_interfaceid": "b71f774f-ceab-4b60-b8c4-b0e7461f4afe", "preserve_on_delete": false, "network": {"bridge": "br-int", "subnets": [{"ips": [{"meta": {}, "version": 4, "type": "fixed", "floating_ips": [], "address": "192.168.111.6"}], "version": 4, "meta": {"dhcp_server": "192.168.111.2"}, "dns": [{"meta": {}, "version": 4, "type": "dns", "address": "8.8.4.4"}, {"meta": {}, "version": 4, "type": "dns", "address": "8.8.8.8"}], "routes": [], "cidr": "192.168.111.0/24", "gateway": {"meta": {}, "version": 4, "type": "gateway", "address": "192.168.111.1"}}], "meta": {"injected": false, "tenant_id": "de7a303be15246b99e4d3c80537f7ac4", "mtu": 1500}, "id": "cddae4f1-dbbe-4f3e-91df-6af6c83d9a95", "label": "admin_internal_net"}, "devname": "tapb71f774f-ce", "vnic_type": "normal", "qbh_params": null, "meta": {}, "details": {"port_filter": true, "ovs_hybrid_plug": true}, "address": "fa:16:3e:e2:1d:59", "active": false, "type": "ovs", "id": "b71f774f-ceab-4b60-b8c4-b0e7461f4afe", "qbg_params": null}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment