Code review comment for ~smoser/cloud-init:aliyun-datasource

Revision history for this message
lawrence peng (kaihuan-pkh) wrote :

> > 3. I found my code not enable DataSourceAliYun by default (it's a
> > mistake), and I wish it could be used like other datasources, so I need
> > add it to cloudinit/settings.py, if I add it to my local branch, should
> > I merge your commit first ? and what sequence to put 'AliYun' insert
> > into settings.py:datasource_list ?
>
> Well, we can't really enable your datasource by default. This is
> unfortunate, but polling on network locations is not really ideal.
> Currently the only datasource that is enabled by default that does this is
> EC2, and that is really only for legacy reasons.
>
> In order to enable the datasource by default, we need to have a way to
> identify without network that this instance is on AliYun. Many of the
> other cloud providers provide a smbios identification, or some other way
> that we definitively determine that we are on that cloud. Then, if we
> don't see that we get out fast without the network polling.
>
> Scott

so I think the primary reason is that cloud-init will block a long time when call datesource's get_data() method if it's use network ?

in our cloud platform, an instance vm could use an asm instructions `cpuid` (with eax setted to 0x40000100 ), it will returned our platform id keyword "AliYun" into register ebx and ecx, and if vm is not running on our environment, the value is others. so I guess this is a method to identify our platform ?

if I change DataSourceAliYun: get_date() method, first I use the method above to detect the evironment, if it is on AliYun, then I could call the super class (ec2) get_date() to fetch meta-date from our meta-server by network. do this ok ?

« Back to merge proposal