disk_setup destroys data despite being told not to.

Bug #1658050 reported by James Masson
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
cloud-init (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

This is the config used.

###
disk_setup:
    /dev/xvdf:
        layout: false
        overwrite: false
        table_type: gpt
fs_setup:
- device: /dev/xvdf
    filesystem: ext4
    label: c6dev-fraud-solr
    partition: none
    overwrite: false
###

1. If partition is set to "none", as above.

the code will skip to here - https://git.launchpad.net/~usd-import-team/ubuntu/+source/cloud-init/tree/cloudinit/config/cc_disk_setup.py?h=applied/debian/sid#n905

... bypassing all of the checks on whether the filesystem exists or not.

This will result in mkfs being executed every time, destroying data, despite "overwrite: false"

2. If partition is set to "any/auto" ....

... to trigger the smart partition matching in https://git.launchpad.net/~usd-import-team/ubuntu/+source/cloud-init/tree/cloudinit/config/cc_disk_setup.py?h=applied/debian/sid#n879

update_fs_setup_devices - https://git.launchpad.net/~usd-import-team/ubuntu/+source/cloud-init/tree/cloudinit/config/cc_disk_setup.py?h=applied/debian/sid#n156

... will detect the lack of partition and silently change the specified partition "any" or "auto" to None - triggering the problem again.

Summary:

No matter what you set for "partition" or "overwrite" in fs_setup - if you are using the raw device, then disk_setup/fs_setup will destroy your data every time.

Bug identified with cloud-init-0.7.5-10.el7.centos.1.x86_64 - from the looks of upstream git-master, it still exists there.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in cloud-init (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.