Discussion:
Disk ID for a provisioned instance
Akshat Jiwan Sharma
2017-10-31 02:37:01 UTC
Permalink
Hi,

I'd like to automate backups for my server provisioned via juju. For that
I'm planning to use terraform. To take a snapshot of the disk, terraform
needs a disk id.

Is there a way I can get disk ID using juju commands? Juju show machine
only gives the capacity of the disk not its id.

On a machine that I deployed on google cloud platform the disk id is same
as the instance id. Can I assume that the disk id is same as the instance
id everywhere?

Thanks,
Akshat
Andrew Wilkins
2017-10-31 02:53:33 UTC
Permalink
Post by Akshat Jiwan Sharma
Hi,
I'd like to automate backups for my server provisioned via juju. For that
I'm planning to use terraform. To take a snapshot of the disk, terraform
needs a disk id.
Is there a way I can get disk ID using juju commands? Juju show machine
only gives the capacity of the disk not its id.
Not at the moment. We'll need to extend the data model and update the
providers to support this. We do record information about volumes that Juju
provisions, but that excludes the root/OS disk.

On a machine that I deployed on google cloud platform the disk id is same
Post by Akshat Jiwan Sharma
as the instance id. Can I assume that the disk id is same as the instance
id everywhere?
No, that's not a safe assumption in general. Which cloud providers are you
using?

Thanks,
Post by Akshat Jiwan Sharma
Akshat
--
Juju mailing list
https://lists.ubuntu.com/mailman/listinfo/juju
Akshat Jiwan Sharma
2017-10-31 05:40:26 UTC
Permalink
Thanks Andrew. I'm using google cloud platform. But also planning to use
aws in the future.

On Tue, Oct 31, 2017 at 8:23 AM, Andrew Wilkins <
On Tue, Oct 31, 2017 at 10:37 AM Akshat Jiwan Sharma <
Post by Akshat Jiwan Sharma
Hi,
I'd like to automate backups for my server provisioned via juju. For that
I'm planning to use terraform. To take a snapshot of the disk, terraform
needs a disk id.
Is there a way I can get disk ID using juju commands? Juju show machine
only gives the capacity of the disk not its id.
Not at the moment. We'll need to extend the data model and update the
providers to support this. We do record information about volumes that Juju
provisions, but that excludes the root/OS disk.
On a machine that I deployed on google cloud platform the disk id is same
Post by Akshat Jiwan Sharma
as the instance id. Can I assume that the disk id is same as the instance
id everywhere?
No, that's not a safe assumption in general. Which cloud providers are you
using?
Thanks,
Post by Akshat Jiwan Sharma
Akshat
--
Juju mailing list
Modify settings or unsubscribe at: https://lists.ubuntu.com/
mailman/listinfo/juju
Andrew Wilkins
2017-10-31 05:53:14 UTC
Permalink
Post by Akshat Jiwan Sharma
Thanks Andrew. I'm using google cloud platform. But also planning to use
aws in the future.
For AWS, we tag the root disk EBS volume with:

key=Name
value=${INST_ID}-root

So if you add a machine in Juju and it gets assigned the instance ID
"inst-foo", then the root disk EBS volume will have a Name tag with the
value "inst-foo-root".

I don't know if we can guarantee that this will remain true forever, but it
hasn't changed in a long time.

HTH,
Andrew
Post by Akshat Jiwan Sharma
On Tue, Oct 31, 2017 at 8:23 AM, Andrew Wilkins <
On Tue, Oct 31, 2017 at 10:37 AM Akshat Jiwan Sharma <
Post by Akshat Jiwan Sharma
Hi,
I'd like to automate backups for my server provisioned via juju. For
that I'm planning to use terraform. To take a snapshot of the disk,
terraform needs a disk id.
Is there a way I can get disk ID using juju commands? Juju show machine
only gives the capacity of the disk not its id.
Not at the moment. We'll need to extend the data model and update the
providers to support this. We do record information about volumes that Juju
provisions, but that excludes the root/OS disk.
On a machine that I deployed on google cloud platform the disk id is same
Post by Akshat Jiwan Sharma
as the instance id. Can I assume that the disk id is same as the instance
id everywhere?
No, that's not a safe assumption in general. Which cloud providers are
you using?
Thanks,
Post by Akshat Jiwan Sharma
Akshat
--
Juju mailing list
https://lists.ubuntu.com/mailman/listinfo/juju
Akshat Jiwan Sharma
2017-10-31 06:03:29 UTC
Permalink
This is very helpful! Thanks.

On Tue, Oct 31, 2017 at 11:23 AM, Andrew Wilkins <
Post by Andrew Wilkins
Post by Akshat Jiwan Sharma
Thanks Andrew. I'm using google cloud platform. But also planning to use
aws in the future.
key=Name
value=${INST_ID}-root
So if you add a machine in Juju and it gets assigned the instance ID
"inst-foo", then the root disk EBS volume will have a Name tag with the
value "inst-foo-root".
I don't know if we can guarantee that this will remain true forever, but
it hasn't changed in a long time.
HTH,
Andrew
Post by Akshat Jiwan Sharma
On Tue, Oct 31, 2017 at 8:23 AM, Andrew Wilkins <
On Tue, Oct 31, 2017 at 10:37 AM Akshat Jiwan Sharma <
Post by Akshat Jiwan Sharma
Hi,
I'd like to automate backups for my server provisioned via juju. For
that I'm planning to use terraform. To take a snapshot of the disk,
terraform needs a disk id.
Is there a way I can get disk ID using juju commands? Juju show machine
only gives the capacity of the disk not its id.
Not at the moment. We'll need to extend the data model and update the
providers to support this. We do record information about volumes that Juju
provisions, but that excludes the root/OS disk.
On a machine that I deployed on google cloud platform the disk id is
Post by Akshat Jiwan Sharma
same as the instance id. Can I assume that the disk id is same as the
instance id everywhere?
No, that's not a safe assumption in general. Which cloud providers are
you using?
Thanks,
Post by Akshat Jiwan Sharma
Akshat
--
Juju mailing list
Modify settings or unsubscribe at: https://lists.ubuntu.com/
mailman/listinfo/juju
Loading...