Merge ~paul-meyer/cloud-init:fix-ntfs-mount into cloud-init:master
Status: | Merged |
---|---|
Approved by: | Scott Moser |
Approved revision: | c4e82b27c2149c000633554c231274bcd3c6e1eb |
Merge reported by: | Scott Moser |
Merged at revision: | aa4eeb80839382117e1813e396dc53aa634fd7ba |
Proposed branch: | ~paul-meyer/cloud-init:fix-ntfs-mount |
Merge into: | cloud-init:master |
Diff against target: |
379 lines (+138/-35) 3 files modified
cloudinit/sources/DataSourceAzure.py (+47/-16) cloudinit/util.py (+3/-2) tests/unittests/test_datasource/test_azure.py (+88/-17) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Scott Moser | Approve | ||
Server Team CI bot | continuous-integration | Approve | |
Ryan Harper | Pending | ||
Review via email: mp+344538@code.launchpad.net |
Commit message
Azure: Ignore NTFS mount errors when checking ephemeral drive
The Azure data source provides a method to check whether a NTFS partition
on the ephemeral disk is safe for reformatting to ext4. The method checks
to see if there are customer data files on the disk. However, mounting
the partition fails on systems that do not have the capability of
mounting NTFS. Note that in this case, it is also very unlikely that the
NTFS partition would have been used by the system (since it can't mount
it). The only case would be where an update to the system removed the
capability to mount NTFS, the likelihood of which is also very small.
This change allows the reformatting of the ephemeral disk to ext4 on
systems where mounting NTFS is not supported.
Description of the change
The change converts a specific mount error to success in the method cloudinit.
Rationale:
The Azure data source provides a method to check whether a NTFS partition no the ephemeral disk is safe for reformatting to ext4. The method checks to see if there are customer data files on the disk. However, mounting the partition fails on systems that do not have the capability of mounting NTFS. Note that in this case, it is also very unlikely that the NTFS partition would have been used by the system (since is can't mount it). The only case would be where an update to the system removed the capability to mount NTFS, the likelihood of which is also very small.
This change allows the reformatting of the ephemeral disk to ext4 on systems where mounting NTFS is not supported.
Testing:
1. On Azure, boot a VM from image RedHat:
2. Update cloud-init (sudo yum update cloud-init)
3. Choose redeploy from the portal (or deallocate and restart VM).
Expected: /dev/sdb1 is formatted ext4
Actual: /dev/sdb1 is formatted ntfs
When this patch is applied between step 2 and 3, the expected result is achieved.
PASSED: Continuous integration, rev:7c44b975ee5 46df18910b620f9 20d673046c4080 /jenkins. ubuntu. com/server/ job/cloud- init-ci/ 1063/
https:/
Executed test runs:
SUCCESS: Checkout
SUCCESS: Unit & Style Tests
SUCCESS: Ubuntu LTS: Build
SUCCESS: Ubuntu LTS: Integration
SUCCESS: MAAS Compatability Testing
IN_PROGRESS: Declarative: Post Actions
Click here to trigger a rebuild: /jenkins. ubuntu. com/server/ job/cloud- init-ci/ 1063/rebuild
https:/