ERROR: "Mounting persistent disk: Partitioning disk: '/dev/sdc' contains a partition created by bosh. No partitioning is allowed." returned when changing the BOSH Director persistent disk size on vSphere
On vSphere, if an operator needs to resize the BOSH Director persistent disk, that should be done using the Ops Manager UI under the Resource Config section of the BOSH Director tile. For more information, refer to Step 10: Resource Config Pane.
However, sometimes users have been known to inadvertently change the size of the BOSH VM persistent disk from vSphere by editing the VM settings.
This causes the new persistent disk to be partitioned and an Apply Changes to the BOSH Director will fail with this error:
Creating instance 'bosh/0': Updating instance disks: Updating disks: Deploying disk: Mounting disk: Sending 'get_task' to the agent: Agent responded with error: Action Failed get_task: Task dbcac8f2-6bd0-43f1-6b8f-929594df82dd result: Mounting persistent disk: Partitioning disk: '/dev/sdc' contains a partition created by bosh. No partitioning is allowed. Exit code 1
Environment
Product Version: 2.10
Cause
This problem is caused by modification of the Bosh Director VM persistent disk size from the vSphere web client prior to updating and applying the disk size increase on Opsmanager using the steps detailed in the Step 10: Resource Config Pane documentation.
Resolution
To fix this issue, follow these steps.
From the Resource Config on the Bosh Director tile change the size of the persistent disk so that it matches what was selected on vSphere.
Resize the persistent disk so that it uses 100% of the disk available by running the command:
parted /dev/sdc resizepart 1 100%
For the first prompt, type FIX to fix the partition. For the second prompt, type 1 for the partition number.
For the third prompt, press enter 4.
To confirm that the disk is being fully utilized and there are no more partitions, run this command:
parted -l /dev/sdc
From the output, analyze the section that describes the disk /dev/sdc and ensure that boxes 1 and 2 have the same value for disk size before proceeding.
Note: It is expected that the disk size displayed in the output above is higher than what you input on the resource config pane. If step 4 still fails, repeat steps 2 and 3. However, this time when you run the command parted /dev/sdc resizepart 1 100%, there won't be prompts anymore but the disk will still be resized to 100%.
Run another Apply Changes on the BOSH Director. This time a new disk should be successfully created and all the information should be properly migrated.