enable AliYun datasource by default

Bug #1638931 reported by Scott Moser on 2016-11-03
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-init
Medium
Junjie.Wang
cloud-init (Ubuntu)
Medium
Unassigned
Xenial
Undecided
Unassigned
Zesty
Undecided
Unassigned

Bug Description

=== Begin SRU Template ===
[Impact]
Ubuntu cloud-images do not identify the Aliyun cloud platform.
Until this change was put in place, they would fail to boot and consume
user-data or metadata there.

With the change in place, an official Ubuntu image from
http://cloud-images.ubuntu.com will work properly on Aliyun.

[Test Case]
The ideal test case is:
a.) download a cloud image, update its cloud-init
    The tool 'get-proposed-cloudimg' [1] can be used to do this.

    [1] https://git.launchpad.net/~smoser/cloud-init/+git/sru-info/tree/bin/get-proposed-cloudimg

b.) publish that image to Aliyun cloud
c.) boot an instance from that image.
d.) verify function by ssh in verifying /run/cloud-init/result.json shows
    that aliyun datasource was used.

Ideally post /var/log/cloud-init.log as an attachment to this bug.

[Regression Potential]
Generally small chance for regression, but a regression would most likely
be seen as an attempt to hit the metadata service at the well known end point
http://100.100.100.200.

This should be fairly well confined as attempts to use the Aliyun datasource
are gated by '_is_aliyun_' which does verifies that the dmi product name is
"Alibaba Cloud ECS"

[Other Info]
Upstream commit at
  https://git.launchpad.net/cloud-init/commit/?id=4a60af5495

=== End SRU Template ===

As discussed at [1], the addition of AliYun datasource did not enable it by default.
This is because it has no definitive check before polling the network for data.

Lawrence suggested he has a solution for this:
 | 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 ?

--
[1] https://code.launchpad.net/~smoser/cloud-init/+git/cloud-init/+merge/309614

Related branches

Scott Moser (smoser) on 2016-11-03
Changed in cloud-init:
assignee: nobody → lawrence peng (kaihuan-pkh)
status: New → Confirmed
importance: Undecided → Medium
Scott Moser (smoser) on 2016-11-10
description: updated
lawrence peng (kaihuan-pkh) wrote :

hi, Scott, as we discussed before, I need execute a `cpuid` assembly code in python, so I think I should write a bit of C code which inline the assemly and compile it as a library, then call it in python by using the ctypes lib.

I wonder to know is this plan could be feasible ? because of cloud-init source code is pure python, if I add the C code, it must compile when installed.

the another hand, there are some third library module in python which could execute assembly, maybe I could import these module instead of write by myself ?

thx ~

Scott Moser (smoser) wrote :

I really dont want to pick up a dependency on a library for this. It seems like surely there is some way to get at this information, or possibly we could work together to find a way for the platform to more obviously identify itself.

Other platforms identify themselves in dmi data.
For example, on an openstack system:

$ cat /sys/class/dmi/id/sys_vendor
OpenStack Foundation
$ cat /sys/class/dmi/id/product_name
OpenStack Nova

Scott Moser (smoser) wrote :

The merge proposal attached here
 https://code.launchpad.net/~jingni.wjj/cloud-init/+git/cloud-init/+ref/aliyun_dev
shows that AliYun is now identifying themselves in product_name of dmi data.
We no longer need the cpuid/c extension.

Scott Moser (smoser) on 2017-05-25
Changed in cloud-init:
assignee: lawrence peng (kaihuan-pkh) → Junjie.Wang (jingni.wjj)
Scott Moser (smoser) on 2017-07-31
Changed in cloud-init (Ubuntu):
status: New → Confirmed
status: Confirmed → Fix Released
importance: Undecided → Medium
Scott Moser (smoser) on 2017-08-01
description: updated

Hello Scott, or anyone else affected,

Accepted cloud-init into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/cloud-init/0.7.9-233-ge586fe35-0ubuntu1~16.04.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-xenial to verification-done-xenial. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-xenial. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in cloud-init (Ubuntu Xenial):
status: New → Fix Committed
tags: added: verification-needed verification-needed-xenial
Changed in cloud-init (Ubuntu Zesty):
status: New → Fix Committed
tags: added: verification-needed-zesty
Chris J Arges (arges) wrote :

Hello Scott, or anyone else affected,

Accepted cloud-init into zesty-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/cloud-init/0.7.9-233-ge586fe35-0ubuntu1~17.04.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-zesty to verification-done-zesty. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-zesty. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Chad Smith (chad.smith) wrote :

Hello Junjie.Wang,

   I believe you may be the best equipped to validate that this SRU works without error on AliYun cloud instances.

Can you validate the bug per verification instructions that
cloud-init version 0.7.9-233-ge586fe35-0ubuntu1~16.04.1 works as expected.

Best regards,
Chad

Chad Smith (chad.smith) wrote :

Verifying this bug as it was originally contributed by the AliYun cloud maintainer as 'working' in their environment. Impact is limited only to the AliYun instances in this case and since we don't have access to easily deploy instance in AliYun's cloud, we take Junjie's recommendation here.

tags: added: verification-done-xenial verification-done-zesty
removed: verification-needed verification-needed-xenial verification-needed-zesty
Launchpad Janitor (janitor) wrote :
Download full text (6.4 KiB)

This bug was fixed in the package cloud-init - 0.7.9-233-ge586fe35-0ubuntu1~16.04.1

---------------
cloud-init (0.7.9-233-ge586fe35-0ubuntu1~16.04.1) xenial-proposed; urgency=medium

  * debian/cloud-init.templates: enable Scaleway cloud.
  * debian/cloud-init.templates: enable Aliyun cloud.
  * drop the following cherry picks, now incorporated in snapshot.
    + debian/patches/cpick-5fb49bac-azure-identify-platform...
    + debian/patches/cpick-003c6678-net-remove-systemd-link...
    + debian/patches/cpick-1cd4323b-azure-remove-accidental...
    + debian/patches/cpick-ebc9ecbc-Azure-Add-network-config...
    + debian/patches/cpick-11121fe4-systemd-make-cloud-final...
  * debian/patches/stable-release-no-jsonschema-dep.patch:
    add patch to remove optional dependency on jsonschema.
  * New upstream snapshot.
    - cloudinit.net: add initialize_network_device function and tests
      [Chad Smith]
    - makefile: fix ci-deps-ubuntu target [Chad Smith]
    - tests: adjust locale integration test to parse default locale.
    - tests: remove 'yakkety' from releases as it is EOL.
    - centos: do not package systemd-fsck drop-in.
    - systemd: make systemd-fsck run after cloud-init.service (LP: #1691489)
    - tests: Add initial tests for EC2 and improve a docstring.
    - locale: Do not re-run locale-gen if provided locale is system default.
    - archlinux: fix set hostname usage of write_file. [Joshua Powers]
    - sysconfig: support subnet type of 'manual'.
    - tools/run-centos: make running with no argument show help.
    - Drop rand_str() usage in DNS redirection detection
      [Bob Aman] (LP: #1088611)
    - sysconfig: use MACADDR on bonds/bridges to configure mac_address
      [Ryan Harper]
    - net: eni route rendering missed ipv6 default route config
      [Ryan Harper] (LP: #1701097)
    - sysconfig: enable mtu set per subnet, including ipv6 mtu
      [Ryan Harper]
    - sysconfig: handle manual type subnets [Ryan Harper]
    - sysconfig: fix ipv6 gateway routes [Ryan Harper]
    - sysconfig: fix rendering of bond, bridge and vlan types.
      [Ryan Harper]
    - Templatize systemd unit files for cross distro deltas. [Ryan Harper]
    - sysconfig: ipv6 and default gateway fixes. [Ryan Harper]
    - net: fix renaming of nics to support mac addresses written in upper
      case. (LP: #1705147)
    - tests: fixes for issues uncovered when moving to python 3.6.
    - sysconfig: include GATEWAY value if set in subnet
      [Ryan Harper]
    - Scaleway: add datasource with user and vendor data for Scaleway.
      [Julien Castets]
    - Support comments in content read by load_shell_content.
    - cloudinitlocal fail to run during boot [Hongjiang Zhang]
    - doc: fix disk setup example table_type options [Sandor Zeestraten]
    - tools: Fix exception handling. [Joonas Kylmälä]
    - tests: fix usage of mock in GCE test.
    - test_gce: Fix invalid mock of platform_reports_gce to return False
      [Chad Smith]
    - test: fix incorrect keyid for apt repository. [Joshua Powers]
    - tests: Update version of pylxd [Joshua Powers]
    - write_files: Remove log from helper function signatures.
      [Andrew Jorgensen]
    - doc: document...

Read more...

Changed in cloud-init (Ubuntu Xenial):
status: Fix Committed → Fix Released

The verification of the Stable Release Update for cloud-init has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Launchpad Janitor (janitor) wrote :
Download full text (6.4 KiB)

This bug was fixed in the package cloud-init - 0.7.9-233-ge586fe35-0ubuntu1~17.04.1

---------------
cloud-init (0.7.9-233-ge586fe35-0ubuntu1~17.04.1) zesty; urgency=medium

  * debian/cloud-init.templates: enable Scaleway cloud.
  * debian/cloud-init.templates: enable Aliyun cloud.
  * drop the following cherry picks, now incorporated in snapshot.
    + debian/patches/cpick-5fb49bac-azure-identify-platform...
    + debian/patches/cpick-003c6678-net-remove-systemd-link...
    + debian/patches/cpick-1cd4323b-azure-remove-accidental...
    + debian/patches/cpick-ebc9ecbc-Azure-Add-network-config...
    + debian/patches/cpick-11121fe4-systemd-make-cloud-final...
  * debian/patches/stable-release-no-jsonschema-dep.patch:
    add patch to remove optional dependency on jsonschema.
  * New upstream snapshot.
    - cloudinit.net: add initialize_network_device function and tests
      [Chad Smith]
    - makefile: fix ci-deps-ubuntu target [Chad Smith]
    - tests: adjust locale integration test to parse default locale.
    - tests: remove 'yakkety' from releases as it is EOL.
    - centos: do not package systemd-fsck drop-in.
    - systemd: make systemd-fsck run after cloud-init.service (LP: #1691489)
    - tests: Add initial tests for EC2 and improve a docstring.
    - locale: Do not re-run locale-gen if provided locale is system default.
    - archlinux: fix set hostname usage of write_file. [Joshua Powers]
    - sysconfig: support subnet type of 'manual'.
    - tools/run-centos: make running with no argument show help.
    - Drop rand_str() usage in DNS redirection detection
      [Bob Aman] (LP: #1088611)
    - sysconfig: use MACADDR on bonds/bridges to configure mac_address
      [Ryan Harper]
    - net: eni route rendering missed ipv6 default route config
      [Ryan Harper] (LP: #1701097)
    - sysconfig: enable mtu set per subnet, including ipv6 mtu
      [Ryan Harper]
    - sysconfig: handle manual type subnets [Ryan Harper]
    - sysconfig: fix ipv6 gateway routes [Ryan Harper]
    - sysconfig: fix rendering of bond, bridge and vlan types.
      [Ryan Harper]
    - Templatize systemd unit files for cross distro deltas. [Ryan Harper]
    - sysconfig: ipv6 and default gateway fixes. [Ryan Harper]
    - net: fix renaming of nics to support mac addresses written in upper
      case. (LP: #1705147)
    - tests: fixes for issues uncovered when moving to python 3.6.
    - sysconfig: include GATEWAY value if set in subnet
      [Ryan Harper]
    - Scaleway: add datasource with user and vendor data for Scaleway.
      [Julien Castets]
    - Support comments in content read by load_shell_content.
    - cloudinitlocal fail to run during boot [Hongjiang Zhang]
    - doc: fix disk setup example table_type options [Sandor Zeestraten]
    - tools: Fix exception handling. [Joonas Kylmälä]
    - tests: fix usage of mock in GCE test.
    - test_gce: Fix invalid mock of platform_reports_gce to return False
      [Chad Smith]
    - test: fix incorrect keyid for apt repository. [Joshua Powers]
    - tests: Update version of pylxd [Joshua Powers]
    - write_files: Remove log from helper function signatures.
      [Andrew Jorgensen]
    - doc: document the cmdli...

Read more...

Changed in cloud-init (Ubuntu Zesty):
status: Fix Committed → Fix Released

This bug is believed to be fixed in cloud-init in 17.1. If this is still a problem for you, please make a comment and set the state back to New

Thank you.

Changed in cloud-init:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers