Skip to content
This repository has been archived by the owner on Jan 5, 2019. It is now read-only.

Why does bosh-init always do disk migration when migrating BOSH director? #80

Open
mattcui opened this issue Jun 6, 2016 · 3 comments

Comments

@mattcui
Copy link

mattcui commented Jun 6, 2016

We found there always triggered disk migration during BOSH director migration using bosh-init. There are much data on the persistence disk of BOSH director, it needs to take lots of time to do disk migration. Is there a way to disable disk migration to keep using the old disk? it's really not needed and very time consuming. Thanks.

/cc @maximilien @jianqiu

@cppforlife
Copy link
Contributor

are you using recent enough version of bosh-init? mine never does disk migration unless size/cloud props are changing.

Sent from my iPhone

On Jun 6, 2016, at 1:55 AM, Matt Cui notifications@github.com wrote:

We found there always triggered disk migration during BOSH director migration using bosh-init. There are much data on the persistence disk of BOSH director, it needs to take lots of time to do disk migration. Is there a way to disable disk migration to keep using the old disk? it's really not needed and very time consuming. Thanks.

/cc @maximilien @jianqiu


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

@jianqiu
Copy link

jianqiu commented Jun 7, 2016

@cppforlife @mattcui

We tried bosh-init-0.0.92. The migration we mentioned is that migrating migrating to bosh-init from the micro CLI plugin, bosh-init will read bosh-deployments.yml, and generated a new state json file, but in the state json file, I saw the disk size is "0", so bosh-init will do disk migration. I am not sure how to indicate disk_size in bosh-deployments.yml which could be parsed and updated into state json.

 "disks": [
        {
            "id": "0cc5c167-4d1d-4e2f-50dc-0f472c015bf9",
            "cid": "11765207",
            "size": 0,
            "cloud_properties": {}
        }
    ],

legacy_deployment_state_migrator.go

if len(legacyDeploymentState.Instances) > 0 {
        instance := legacyDeploymentState.Instances[0]
        diskCID := instance.DiskCID
        if diskCID != "" {
            uuid, err := m.uuidGenerator.Generate()
            if err != nil {
                return deploymentState, bosherr.WrapError(err, "Generating UUID")
            }

            deploymentState.CurrentDiskID = uuid
            deploymentState.Disks = []DiskRecord{
                {
                    ID:              uuid,
                    CID:             diskCID,
                    Size:            0,
                    CloudProperties: biproperty.Map{},
                },
            }
        }

@cppforlife
Copy link
Contributor

right, during migration from micro CLI to bosh-init it needs to do it because it doesnt have enough information. if you want to bypass this you can manually migrate your state file to a new format which if migrated correctly wouldnt result in disk migration.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants