Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create an /etc/fstab entry when storage is attached #9599

Merged
merged 1 commit into from
Jan 9, 2019

Conversation

wallyworld
Copy link
Member

Description of change

When a block device is attached for storage, create an /etc/fstab entry.
Delete the /etc/fstab entry when storage is detached.

QA steps

bootstrap aws
deploy postgresql with storage
ssh into the postgresql machine and check that there's an fstab entry matching the mtab entry
detach the storage
ensure that the fstab entry is removed

Bug reference

https://bugs.launchpad.net/juju/+bug/1783419

Copy link
Contributor

@babbageclunk babbageclunk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, some superficial tweaks.

return errors.Trace(err)
}

if _, err = f.WriteString("\n" + entry + "\n"); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe a comment to indicate that the file will be at the end now?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

err := ioutil.WriteFile(filepath.Join(s.fakeEtcDir, "fstab"), []byte(nonRelatedFstabEntry), 0644)
c.Assert(err, jc.ErrorIsNil)

mtabEntry := fmt.Sprintf("%s %s other mtab stuff", "/dev/sda1", testMountPoint)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be a bit clearer with /dev/sda1 in the format string rather than subbed in.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@wallyworld
Copy link
Member Author

$$merge$$

2 similar comments
@wallyworld
Copy link
Member Author

$$merge$$

@wallyworld
Copy link
Member Author

$$merge$$

@jujubot jujubot merged commit 6ad9165 into juju:develop Jan 9, 2019
@wallyworld
Copy link
Member Author

wallyworld pushed a commit to wallyworld/juju that referenced this pull request Jan 11, 2019
juju#9599

## Description of change

When a block device is attached for storage, create an /etc/fstab entry.
Delete the /etc/fstab entry when storage is detached.

## QA steps

bootstrap aws
deploy postgresql with storage
ssh into the postgresql machine and check that there's an fstab entry matching the mtab entry
detach the storage
ensure that the fstab entry is removed

## Bug reference

https://bugs.launchpad.net/juju/+bug/1783419
jujubot added a commit that referenced this pull request Jan 11, 2019
#9621

## Description of change

Backport some storage fixes from develop:

#9599 
When a block device is attached for storage, create an /etc/fstab entry.
Delete the /etc/fstab entry when storage is detached.

#9607
Deploying a charm with storage to maas fails if a placement directive is used, eg --to zone=<blah>.
The PR fixes the underlying deployment logic to support that case.

Also forward port AWS storage fix from 2.4:

#9620
AWS can provision xen pv volumes such that udev info is missing any hardware identifying characteristics. In this case, we need to force a fallback to match on device name, which is not perfect but it's all we can do.

## QA steps

bootstrap aws and maas and test postgresql deployments with storage

## Bug reference

https://bugs.launchpad.net/juju/+bug/1783419
https://bugs.launchpad.net/juju/+bug/1765959
https://bugs.launchpad.net/juju/+bug/1809478
jujubot added a commit that referenced this pull request Jan 16, 2019
#9629

## Description of change

Merge 2.5 into develop picking up these PRs:

#9626 fix list offers on k8s models
#9625 improved txn pruning
#9622 incorrect arch for ec2 a1 instances
#9620 handle storage with aws xen pv volumes
#9599 write storage mounts to /etc/fstab
#9607 maas storage with zone placement
#9619 fix raft worker timeouts
#9612 Bug 1808947 fix
#9585 unplace missing charm profile upgrade data

## QA steps

bootstrap smoke test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants