美文网首页
在OpenStack VM内得到Instance ID的方法

在OpenStack VM内得到Instance ID的方法

作者: louyang | 来源:发表于2019-03-13 16:18 被阅读0次
    openstack server list
    [cranuser2@controller-1 ~(keystone_cranuser2)]$ openstack server list | grep -e mn-0 -e up-0
    | 94975be1-642f-4522-8a11-c3fa70b6e704 | RCP-1234-up-0 | ACTIVE | extnet-vlan-0=2a00:8a00:8000:5002:0:17:0:4, 10.107.115.54; RCP-1234-internal-net=192.168.1.13; RCP-1234-intmsg0-net=169.254.0.5                                                                                                                             | rcp2.0-ci2019-03-11-13-31 | rcp_large_v4  |
    | a0c6ea5d-f0cf-476a-8ee4-f41bd846e059 | RCP-1234-mn-0 | ACTIVE | RCP-1234-internal-net=192.168.1.9; extnet-vlan-4=2a00:8a00:8000:5002:0:17:0:41d, 10.107.116.26; RCP-1234-intmsg0-net=169.254.0.4                                                                                                                            | rcp2.0-ci2019-03-11-13-31 | rcp_large_v4  |
    
    
    up-0
    [robot@up-0:/home/robot]
    $ curl http://169.254.169.254/openstack/2017-02-22/meta_data.json 2>/dev/null | python -m json.tool | grep "uuid\""
        "uuid": "94975be1-642f-4522-8a11-c3fa70b6e704"
    
    mn-0
    [robot@mn-0:/home/robot]
    $ curl http://169.254.169.254/openstack/2017-02-22/meta_data.json 2>/dev/null | python -m json.tool | grep "uuid\""
        "uuid": "a0c6ea5d-f0cf-476a-8ee4-f41bd846e059"
    
    参考

    https://docs.openstack.org/nova/latest/user/metadata-service.html

    相关文章

      网友评论

          本文标题:在OpenStack VM内得到Instance ID的方法

          本文链接:https://www.haomeiwen.com/subject/bactmqtx.html