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

cloudprovider/aws: prefer '/dev/xvdX' over '/dev/sdX' for device names #27545

Closed

Conversation

simonswine
Copy link
Contributor

* cloudprovider/aws: prefer '/dev/xvdX' over '/dev/sdX' for device names

Analytics

If the root device name can not be detected on AWS, fallback to /dev/xvdX instead of /dev/sdX device names.

@k8s-bot
Copy link

k8s-bot commented Jun 16, 2016

Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test".
(Note: "add to whitelist" is no longer supported. Please update configurations in kubernetes/test-infra/jenkins/job-configs/kubernetes-jenkins-pull instead.)

This message may repeat a few times in short succession due to jenkinsci/ghprb-plugin#292. Sorry.

Otherwise, if this message is too spammy, please complain to ixdy.

3 similar comments
@k8s-bot
Copy link

k8s-bot commented Jun 16, 2016

Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test".
(Note: "add to whitelist" is no longer supported. Please update configurations in kubernetes/test-infra/jenkins/job-configs/kubernetes-jenkins-pull instead.)

This message may repeat a few times in short succession due to jenkinsci/ghprb-plugin#292. Sorry.

Otherwise, if this message is too spammy, please complain to ixdy.

@k8s-bot
Copy link

k8s-bot commented Jun 16, 2016

Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test".
(Note: "add to whitelist" is no longer supported. Please update configurations in kubernetes/test-infra/jenkins/job-configs/kubernetes-jenkins-pull instead.)

This message may repeat a few times in short succession due to jenkinsci/ghprb-plugin#292. Sorry.

Otherwise, if this message is too spammy, please complain to ixdy.

@k8s-bot
Copy link

k8s-bot commented Jun 16, 2016

Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test".
(Note: "add to whitelist" is no longer supported. Please update configurations in kubernetes/test-infra/jenkins/job-configs/kubernetes-jenkins-pull instead.)

This message may repeat a few times in short succession due to jenkinsci/ghprb-plugin#292. Sorry.

Otherwise, if this message is too spammy, please complain to ixdy.

@k8s-github-robot k8s-github-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. release-note-label-needed labels Jun 16, 2016
@justinsb
Copy link
Member

Thanks for this... I think though that we're actually always using xvd style names now. (Which makes us HVM only as well)

I'm trying out this patch right now:

diff --git a/pkg/cloudprovider/providers/aws/aws.go b/pkg/cloudprovider/providers/aws/aws.go
index f3537e2..43385f4 100644
--- a/pkg/cloudprovider/providers/aws/aws.go
+++ b/pkg/cloudprovider/providers/aws/aws.go
@@ -1337,12 +1337,9 @@ func (c *AWSCloud) AttachDisk(diskName string, instanceName string, readOnly boo

        // Inside the instance, the mountpoint always looks like /dev/xvdX (?)
        hostDevice := "/dev/xvd" + string(mountDevice)
-       // In the EC2 API, it is sometimes is /dev/sdX and sometimes /dev/xvdX
-       // We are running on the node here, so we check if /dev/xvda exists to determine this
+       // We are using xvd names (so we are HVM only)
+       // See http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/device_naming.html
        ec2Device := "/dev/xvd" + string(mountDevice)
-       if _, err := os.Stat("/dev/xvda"); os.IsNotExist(err) {
-               ec2Device = "/dev/sd" + string(mountDevice)
-       }

        // attachEnded is set to true if the attach operation completed
        // (successfully or not)

@justinsb
Copy link
Member

I proposed a PR with the above change in #27628

@simonswine
Copy link
Contributor Author

closing this in favor of #27628

@simonswine simonswine closed this Jun 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants