Retrieving Xenstore Networking settings from within a Rackspace Server

When a customer of ours is having issues with their networking, such as the configured gateway or netmask, we are able to provide a oneliner that allows them to run on the VM guest a command which takes the information directly from xenstore, (xe-linux-distribution). Find the command below.

xenstore-read vm-data/networking/$(xenstore-ls vm-data/networking | awk '/private/{print$1}')
{"label": "private", "broadcast": "", "ips": [{"ip": "", "netmask": "", "enabled": "1", "gateway": null}], "mac": "BC:76:4E:11:11:11", "dns": ["", ""], "routes": [{"route": "", "netmask": "", "gateway": ""}, {"route": "", "netmask": "", "gateway": ""}], "gateway": null}

Please note that the information was modified for privacy. This is just grabbing servicenet. To gather all the vm-data use

xenstore-ls vm-data

Altogether now:

Step 1. Retrieve all vm-data

$ xenstore-ls vm-data
 user-metadata = ""
 rax_service_level_automation = ""Complete""
 build_config = """"
networking = ""
 BC764E182CB = "{"label": "private", "broadcast": "", "ips": [{"ip": "", "netmask": "", "enabled": "1", "gateway": null}], "mac": "BC:76\..."
 BC764E0192DB = "{"ip6s": [{"ip": "2a00:1a48:7803:107:be76:4eff::", "netmask": 64, "enabled": "1", "gateway": "fg80::def"}], "label": "public", "broadcast": "\..."
meta = "{"rxtx_cap": 80.0}"
auto-disk-config = "False"

Step 2. Retrieve data for Network MACID

xenstore-read vm-data/networking/BC764E182CB
"label": "private", "broadcast": "", "ips": [{"ip": "", "netmask": "", "enabled": "1", "gateway": null}], "mac": "", "dns": ["", ""], "routes": [{"route": "", "netmask": "", "gateway": ""}, {"route": "", "netmask": "", "gateway": ""}], "gateway": null}
xenstore-read vm-data/networking/BC764E0192DB
{"ip6s": [{"ip": "2a00:1a48:7803:107:be76:4eff:fe08:9cc3", "netmask": 64, "enabled": "1", "gateway": "fe80::def"}], "label": "public", "broadcast": "", "ips": [{"ip": "", "netmask": "", "enabled": "1", "gateway": ""}], "mac": "", "gateway_v6": "ge77::def", "dns": ["", ""], "gateway": ""}

Please note I sanitised the MACID and IP address information, altering it not to show my real ips and subnets, it is just to give you an idea of the two virtual intefaces, publicnet & servicenet.

Leave a Reply

Your email address will not be published. Required fields are marked *