<p>You can run,</p>
<pre><code>cloud-init query instance_id
</code></pre>
<p>Or, you can find the <code>INSTANCE_ID</code>, by looking in this file,</p>
<pre><code>/var/lib/cloud/data/instance-id
</code></pre>
<p>Or, this one</p>
<pre><code>/run/cloud-init/.instance-id
</code></pre>

CC BY-SA 4.0
2022-02-22T04:09:09.530Z
2022-03-17T01:45:23.593Z
2022-03-17T01:45:23.593Z
Evan Carroll
<p>How can I find the <a href="https://cloudinit.readthedocs.io/en/latest/topics/instancedata.html#v1-instance-id" rel="nofollow noreferrer">Instance ID</a> referred to by Cloud-Init as provided by OpenStack?</p>

<openstack>
How can I find the INSTANCE_ID from a provisioned machine?
Evan Carroll
# How can I find the INSTANCE_ID from a provisioned machine?

(Asked by: username_0 on 2022-02-22)

How can I find the [Instance ID](https://cloudinit.readthedocs.io/en/latest/topics/instancedata.html#v1-instance-id) referred to by Cloud-Init as provided by OpenStack?

**Tags:** openstack


---

## 1 answers

### Answer by username_0 on 2022-02-22. Score: 0 | Accepted answer

You can run,
cloud-init query instance_id

Or, you can find the INSTANCE_ID, by looking in this file,
/var/lib/cloud/data/instance-id

Or, this one
/run/cloud-init/.instance-id


---

