[
https://issues.apache.org/jira/browse/CASSANDRA-7147?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17738544#comment-17738544
]
Stefan Miklosovic commented on CASSANDRA-7147:
----------------------------------------------
Interesting.
I see three ways how to do this:
1) based on the example in (1)
{code}
## template: jinja
#cloud-config
runcmd:
- echo 'TestVariable {{ ds.meta_data.variable1 }}' >> /tmp/variable
- echo 'Hostname {{ ds.meta_data.public_hostname }}' > /tmp/hostname
{code}
So, from Cloudstack perspective, one would put this snippet into the
configuration and then the snitch would be configured to read it from a file
and it would parse datacenter / rack.
2)
If there is so called "data server" as you mentioned, then we could read it
from it as well.
https://docs.cloudstack.apache.org/en/latest/adminguide/virtual_machines/user-data.html#storing-and-accessing-userdata
3) reading dhcp lease files
This approach seems to still exist (3). It is basically same method the current
CloudstackSnitch implements.
I am not sure which approach is the best. It seems like the current approach is
indeed doable.
When it comes to 3), I see that approach to be slightly better as there is this
in the documentation:
_If can’t or don’t want to use the virtual router’s DNS service, it’s also
possible to determine the user-data server from a DHCP lease._
So, it seems to me like 3) is the approach which will always work, even a user
can not use or does not use virtual router's DNS service, but leases would
always work.
(1)
https://docs.cloudstack.apache.org/en/latest/adminguide/virtual_machines/user-data.html
(2)
https://docs.cloudstack.apache.org/en/latest/adminguide/virtual_machines/user-data.html#storing-and-accessing-userdata
(3)
https://docs.cloudstack.apache.org/en/latest/adminguide/virtual_machines/user-data.html#determining-the-virtual-router-address-without-dns
> Add a new snitch for Apache Cloudstack platforms
> ------------------------------------------------
>
> Key: CASSANDRA-7147
> URL: https://issues.apache.org/jira/browse/CASSANDRA-7147
> Project: Cassandra
> Issue Type: Improvement
> Environment: Virtual machine on Apache Cloudstack environments
> Reporter: Pierre-Yves Ritschard
> Assignee: Pierre-Yves Ritschard
> Priority: Low
> Fix For: 1.2.18, 2.0.8, 2.1 rc1
>
> Attachments: 0001-initial-work-on-a-cloudstack-snitch.patch
>
>
> The attached patch adds a new Snitch that queries meta data for a host on
> Apache Cloudstack environments. Since the metadata service is colocated with
> the DHCP service in Cloudstack, common lease file locations are looked up to
> retrieve.
> Since zone naming is freeform in Apache Cloudstack, the widely used
> <country>-<location>-<az> notation is assumed.
> The patch includes a simple unit test and has been tested on exoscale.ch, a
> public cloud based on Apache Cloudstack
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]