← Back to team overview

group.of.nepali.translators team mailing list archive

[Bug 1634678] Re: fs_setup always creates new filesystem with partition 'auto'

 

This bug was fixed in the package cloud-init - 0.7.9-90-g61eb03fe-
0ubuntu1~16.04.1

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

  * debian/cloud-init.templates: add Bigstep to list of sources. (LP: #1676460)
  * New upstream snapshot.
    - OpenStack: add 'dvs' to the list of physical link types. (LP: #1674946)
    - Fix bug that resulted in an attempt to rename bonds or vlans.
      (LP: #1669860)
    - tests: update OpenNebula and Digital Ocean to not rely on host
      interfaces.
    - net: in netplan renderer delete known image-builtin content.
      (LP: #1675576)
    - doc: correct grammar in capabilities.rst [David Tagatac]
    - ds-identify: fix detecting of maas datasource. (LP: #1677710)
    - netplan: remove debugging prints, add debug logging [Ryan Harper]
    - ds-identify: do not write None twice to datasource_list.
    - support resizing partition and rootfs on system booted without
      initramfs.  [Steve Langasek] (LP: #1677376)
    - apt_configure: run only when needed. (LP: #1675185)
    - OpenStack: identify OpenStack by product 'OpenStack Compute'.
      (LP: #1675349)
    - GCE: Search GCE in ds-identify, consider serial number in check.
      (LP: #1674861)
    - Add support for setting hashed passwords [Tore S. Lonoy] (LP: #1570325)
    - Fix filesystem creation when using "partition: auto"
      [Jonathan Ballet] (LP: #1634678)
    - ConfigDrive: support reading config drive data from /config-drive.
      (LP: #1673411)
    - ds-identify: fix detection of Bigstep datasource. (LP: #1674766)
    - test: add running of pylint [Joshua Powers]
    - ds-identify: fix bug where filename expansion was left on.
    - advertise network config v2 support (NETWORK_CONFIG_V2) in features.
    - Bigstep: fix bug when executing in python3. [root]
    - Fix unit test when running in a system deployed with cloud-init.
    - Bounce network interface for Azure when using the built-in path.
      [Brent Baude] (LP: #1674685)
    - cloudinit.net: add network config v2 parsing and rendering [Ryan Harper]
    - net: Fix incorrect call to isfile [Joshua Powers] (LP: #1674317)
    - net: add renderers for automatically selecting the renderer.
    - doc: fix config drive doc with regard to unpartitioned disks.
      (LP: #1673818)
    - test: Adding integratiron test for password as list [Joshua Powers]
    - render_network_state: switch arguments around, do not require target
    - support 'loopback' as a device type.
    - Integration Testing: improve testcase subclassing [Wesley Wiedenmeier]
    - gitignore: adding doc/rtd_html [Joshua Powers]
    - doc: add instructions for running integration tests via tox.
      [Joshua Powers]
    - test: avoid differences in 'date' output due to daylight savings.
    - Fix chef config module in omnibus install. [Jeremy Melvin] (LP: #1583837)
    - Add feature flags to cloudinit.version. [Wesley Wiedenmeier]
    - tox: add a citest environment
    - Support chpasswd/list being a list in addition to a string.
      [Sergio Lystopad] (LP: #1665694)
    - doc: Fix configuration example for cc_set_passwords module.
      [Sergio Lystopad] (LP: #1665773)
    - net: support both ipv4 and ipv6 gateways in sysconfig.
      [Lars Kellogg-Stedman] (LP: #1669504)
    - net: do not raise exception for > 3 nameservers
      [Lars Kellogg-Stedman] (LP: #1670052)

 -- Scott Moser <smoser@xxxxxxxxxx>  Mon, 03 Apr 2017 11:52:56 -0400

** Changed in: cloud-init (Ubuntu Xenial)
       Status: Fix Committed => Fix Released

-- 
You received this bug notification because you are a member of नेपाली
भाषा समायोजकहरुको समूह, which is subscribed to Xenial.
Matching subscriptions: Ubuntu 16.04 Bugs
https://bugs.launchpad.net/bugs/1634678

Title:
  fs_setup always creates new filesystem with partition 'auto'

Status in cloud-init:
  Fix Committed
Status in cloud-init package in Ubuntu:
  Fix Released
Status in cloud-init source package in Trusty:
  Confirmed
Status in cloud-init source package in Xenial:
  Fix Released
Status in cloud-init source package in Yakkety:
  Fix Released

Bug description:
    
  === Begin SRU Template ===
  [Impact] 
  On instance first boot cloud-init may create a filesystem when
  it should have re-used an existing filesystem.

  [Test Case]
  The test case launches an instance, assuming that has an old version
  of cloud-init inside.  The user-data will not be valid for the default
  configuration of disks.  (Most openstack instances would have a
  single 'ephemeral' disk in addition to root, with an ext4 filesystem
  labelled 'ephemeral0').  We will then upgrade instance to proposed.
  And create a filesystem on /dev/vdb1 that *should* match.

  1. launch an instance in openstack with the following user-data.
     |#cloud-config
     |fs_setup:
     |  - label: mydata
     |    device: /dev/vdb
     |    filesystem: ext4
     |    partition: auto
     |mounts:
     |  - ["/dev/vdb1", "/mnt"]
     
     $ cat > my-userdata.txt <<EOF
     #cloud-config
     fs_setup:
       - label: mydata
         device: /dev/vdb
         filesystem: ext4
         partition: auto
     mounts:
       - ["/dev/vdb1", "/mnt"]
     EOF

     $ openstack server create --user-data=my-userdata.txt \
        --key-name=brickies --flavor=m1.small .... my-test

  
  2. ssh in, prepare the /dev/vdb to have a partition, and upgrade

    # run attached 'disk-setup'. This will partition the disk
    # and wipe any filesystem data off, basically making it a partitioned
    # but otherwise empty disk.
    $ sudo ./disk-setup
    umount: /mnt: not mounted
    wiping /dev/vdb
    partitioning /dev/vdb
    /dev/vdb: PTUUID="9920db9b-a1ff-4f44-834c-8fcc42bd5821" PTTYPE="gpt"
    /dev/vdb1: PARTUUID="1accde8d-8880-4a93-913a-61eee2e92535"

  
  3. enable proposed, upgrade
  4. clean out state and reboot
     sudo rm -Rf /var/lib/cloud /var/log/cloud-init*
     sudo sed -i '/comment=cloudconfig/d' /etc/fstab
     sudo reboot

  5. ssh back in and look around.
    
     # cloud-init should have created a filesystem on /dev/vdb1
     # and mounted it at /mnt.

     $ grep /mnt /proc/mounts 
     /dev/vdb1 /mnt ext4 rw,relatime,data=ordered 0 0

     # and have a filesystem 'mydata'
     $ sudo blkid /dev/vdb1
     /dev/vdb1: LABEL="mydata" UUID="79090091-800e-4348-a7a9-8c7a26ed18f7" TYPE="ext4" PARTUUID="b8ef8d3f-acb4-4bd0-ba2d-fdfb45c2e8f0"

  
     # put a file on there, then clean up and reboot.
     # we will expect that that this time, cloud-init will just re-use
     # the existing filesystem rather than making another.
     $ echo hi mom | sudo tee -a /mnt/my-important-data.txt

  6. ssh in and expect /mnt/my-important-data.txt

     $ cat /mnt/my-important-data.txt
     hi mom

  [Regression Potential] 
  Potentially this could re-use a partition that the user wanted reformatted.

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

  === End SRU Template ===

  # cloud-init -v
  cloud-init 0.7.5

  # lsb_release -a
  No LSB modules are available.
  Distributor ID: Ubuntu
  Description:    Ubuntu 14.04.4 LTS
  Release:        14.04
  Codename:       trusty

  AMI: ami-1721ff77 - Ubuntu 14.04 20160314

  fs_setup fails to detect an existing filesystem and creates a new one
  when using the following configuration:

  fs_setup:
      label: None
      filesystem: ext4
      device: /dev/xvdf
      partition: auto

  There error seems to be here - https://git.launchpad.net/cloud-init/tree/cloudinit/config/cc_disk_setup.py#n216
  This line sets definition['partition'] to None.

  I believe " definition['partition'] = part" should be a part of the
  above conditional.

To manage notifications about this bug go to:
https://bugs.launchpad.net/cloud-init/+bug/1634678/+subscriptions