{"action":"opened","issue":{"url":"https://api.github.com/repos/cloudfoundry/bosh-agent/issues/154","repository_url":"https://api.github.com/repos/cloudfoundry/bosh-agent","labels_url":"https://api.github.com/repos/cloudfoundry/bosh-agent/issues/154/labels{/name}","comments_url":"https://api.github.com/repos/cloudfoundry/bosh-agent/issues/154/comments","events_url":"https://api.github.com/repos/cloudfoundry/bosh-agent/issues/154/events","html_url":"https://github.com/cloudfoundry/bosh-agent/issues/154","id":285069695,"number":154,"title":"Partitioning fails for disks > 2TB and resized by the IaaS","user":{"login":"beyhan","id":517762,"avatar_url":"https://avatars2.githubusercontent.com/u/517762?v=4","gravatar_id":"","url":"https://api.github.com/users/beyhan","html_url":"https://github.com/beyhan","followers_url":"https://api.github.com/users/beyhan/followers","following_url":"https://api.github.com/users/beyhan/following{/other_user}","gists_url":"https://api.github.com/users/beyhan/gists{/gist_id}","starred_url":"https://api.github.com/users/beyhan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beyhan/subscriptions","organizations_url":"https://api.github.com/users/beyhan/orgs","repos_url":"https://api.github.com/users/beyhan/repos","events_url":"https://api.github.com/users/beyhan/events{/privacy}","received_events_url":"https://api.github.com/users/beyhan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-12-29T10:26:42Z","updated_at":"2017-12-29T10:26:42Z","closed_at":null,"author_association":"MEMBER","body":"Agent uses the `parted` partitioner for disk > 2TB. If such a disk is resized by the IaaS with the `resize_disk` CPI method, agent will fail to partition it. The agent log is:\r\n```\r\n2017-12-29_09:03:19.94899 ********************\r\n2017-12-29_09:03:19.94899 [linuxPlatform] 2017/12/29 09:03:19 INFO - realPath = /dev/vdb, devicePath = , isMountPoint = %!s(bool=false)\r\n2017-12-29_09:03:19.94899 [File System] 2017/12/29 09:03:19 DEBUG - Making dir /var/vcap/store with perm 0700\r\n2017-12-29_09:03:19.94900 [Cmd Runner] 2017/12/29 09:03:19 DEBUG - Running command 'lsblk --nodeps -nb -o SIZE /dev/vdb'\r\n2017-12-29_09:03:19.95071 [Cmd Runner] 2017/12/29 09:03:19 DEBUG - Stdout: 2672543399936\r\n2017-12-29_09:03:19.95072 [Cmd Runner] 2017/12/29 09:03:19 DEBUG - Stderr:\r\n2017-12-29_09:03:19.95072 [Cmd Runner] 2017/12/29 09:03:19 DEBUG - Successful: true (0)\r\n2017-12-29_09:03:19.95072 [linuxPlatform] 2017/12/29 09:03:19 DEBUG - Persistent disk size to be partitioned is: 2672543399936, and error is: <nil>\r\n2017-12-29_09:03:19.95073 [linuxPlatform] 2017/12/29 09:03:19 DEBUG - parted partitioner was chosen\r\n2017-12-29_09:03:19.95073 [Cmd Runner] 2017/12/29 09:03:19 DEBUG - Running command 'parted -m /dev/vdb unit B print'\r\n2017-12-29_09:03:19.96018 panic: runtime error: index out of range\r\n2017-12-29_09:03:19.96018\r\n2017-12-29_09:03:19.96019 goroutine 9 [running]:\r\n2017-12-29_09:03:19.96019 github.com/cloudfoundry/bosh-agent/platform/disk.partedPartitioner.getPartitions(0xc5d280, 0xc420017a80, 0xc5c680, 0xc420148590, 0x9cd615, 0x11, 0xc5c2c0, 0xd44898, 0xc4202b62e8, 0x8, ...)\r\n2017-12-29_09:03:19.96019       /tmp/build/9674af12/gopath/src/github.com/cloudfoundry/bosh-agent/platform/disk/parted_partitioner.go:123 +0xb37\r\n2017-12-29_09:03:19.96021 github.com/cloudfoundry/bosh-agent/platform/disk.partedPartitioner.Partition(0xc5d280, 0xc420017a80, 0xc5c680, 0xc420148590, 0x9cd615, 0x11, 0xc5c2c0, 0xd44898, 0xc4202b62e8, 0x8, ...)\r\n2017-12-29_09:03:19.96021       /tmp/build/9674af12/gopath/src/github.com/cloudfoundry/bosh-agent/platform/disk/parted_partitioner.go:35 +0x6c\r\n2017-12-29_09:03:19.96021 github.com/cloudfoundry/bosh-agent/platform/disk.(*partedPartitioner).Partition(0xc42012a800, 0xc4202b62e8, 0x8, 0xc4202b15a0, 0x1, 0x1, 0x0, 0x0)\r\n2017-12-29_09:03:19.96021       <autogenerated>:40 +0xaa\r\n2017-12-29_09:03:19.96022 github.com/cloudfoundry/bosh-agent/platform.linux.MountPersistentDisk(0xc5f260, 0xc42012a340, 0xc5c680, 0xc420148590, 0xc5caa0, 0xc420010be0, 0xc59920, 0xc4200c9f60, 0xc57220, 0xc4200c9f80, ...)\r\n2017-12-29_09:03:19.96022       /tmp/build/9674af12/gopath/src/github.com/cloudfoundry/bosh-agent/platform/linux_platform.go:1071 +0x13f7\r\n2017-12-29_09:03:19.96085 github.com/cloudfoundry/bosh-agent/platform.(*linux).MountPersistentDisk(0xc42007b040, 0xc4201bc570, 0x24, 0x0, 0x0, 0xc4201a6eb8, 0x8, 0x0, 0x0, 0x0, ...)\r\n2017-12-29_09:03:19.96085       <autogenerated>:154 +0xba\r\n2017-12-29_09:03:19.96085 github.com/cloudfoundry/bosh-agent/agent.bootstrap.Run(0xc5f260, 0xc42012a340, 0xc625e0, 0xc42007b040, 0x9c6867, 0x9, 0xc59660, 0xc4201331e0, 0xc5d280, 0xc420017a80, ...)\r\n2017-12-29_09:03:19.96085       /tmp/build/9674af12/gopath/src/github.com/cloudfoundry/bosh-agent/agent/bootstrap.go:156 +0x23a6\r\n2017-12-29_09:03:19.96086 github.com/cloudfoundry/bosh-agent/agent.(*bootstrap).Run(0xc420010d70, 0xc42007b040, 0x9c6867)\r\n2017-12-29_09:03:19.96086       <autogenerated>:16 +0x5c\r\n2017-12-29_09:03:19.96086 github.com/cloudfoundry/bosh-agent/app.(*app).Setup(0xc42000ab00, 0x0, 0x0, 0x7ffd83d33f22, 0x6, 0x9c6867, 0x9, 0x9c2c3d, 0x5, 0x7ffd83d33f2c, ...)\r\n2017-12-29_09:03:19.96086       /tmp/build/9674af12/gopath/src/github.com/cloudfoundry/bosh-agent/app/app.go:112 +0xd2c\r\n2017-12-29_09:03:19.96087 main.runAgent.func1(0xc5d280, 0xc420017a80, 0x0, 0x0, 0x7ffd83d33f22, 0x6, 0x9c6867, 0x9, 0x9c2c3d, 0x5, ...)\r\n2017-12-29_09:03:19.96087       /tmp/build/9674af12/gopath/src/github.com/cloudfoundry/bosh-agent/main/agent.go:30 +0x226\r\n2017-12-29_09:03:19.96087 created by main.runAgent\r\n2017-12-29_09:03:19.96088       /tmp/build/9674af12/gopath/src/github.com/cloudfoundry/bosh-agent/main/agent.go:43 +0xb9\r\n2017-12-29_09:03:19.97082 [main] 2017/12/29 09:03:19 DEBUG - Starting agent\r\n``` \r\nThe output of the `parted -m /dev/vdb unit B print` command in this case is\r\n```\r\nparted -m /dev/vdb unit B print\r\nError: The backup GPT table is not at the end of the disk, as it should be.  This might mean that another operating system believes the disk is smaller.  Fix, by moving the backup to the end (and removing the old backup)?\r\nFix/Ignore/Cancel?\r\n```\r\n`GPT` partition table is used with `parted` partitioner and it is at the start and the end of the disk. After the resize by the IaaS the partition table is not any more at the end. That is why we get this error. Fixing the partition table manually and afterwards fixing the VM with `bosh cck` fails with:\r\n```\r\nTask 177 | 09:49:09 | Applying problem resolutions: VM for 'dummy/5c862054-580b-4e4c-a2e5-f48c88e6c1cf (0)' with cloud ID 'f58e112a-0c9e-456f-a21f-4db5efa075ae' is not responding. (unresponsive_agent 8): Recreate VM and wait for processes to start (00:01:49)\r\n                    L Error: Action Failed get_task: Task 9e2ca860-6322-4e21-6925-fb968dcbbf2b result: Mounting persistent disk: Partitioning disk: '/dev/vdb' contains a partition created by bosh. No partitioning is allowed.\r\nTask 177 | 09:50:58 | Error: Error resolving problem '48': Action Failed get_task: Task 9e2ca860-6322-4e21-6925-fb968dcbbf2b result: Mounting persistent disk: Partitioning disk: '/dev/vdb' contains a partition created by bosh. No partitioning is allowed.\r\n``` \r\nThis is desired and was implemented with this story https://www.pivotaltracker.com/n/projects/956238/stories/141166603.\r\n\r\nThis issue depends on the resolution of https://github.com/cloudfoundry/bosh/issues/1870.  Using the BOSH resize workflow and not the IaaS resize feature works with disks > 2TB. "}}
{"actor":{"display_login":"beyhan"}}