kusnier/vagrant-persistent-storage

Doesn't work with ubuntu/xenial64

Opened this issue · 7 comments

Hi,

This plugin seems to not work with the current LTS release of Ubuntu. I'm afraid I don't understand this stuff well enough yet, but I'm pretty sure that Trusty uses a SATA controller for it's disk, whereas Xenial uses SCSII.

When I try to vagrant up, not a lot happens, connecting directly to the box it's plain to see why...
image

Looking at the storage controllers: if I go with the default then the persistent storage ends up on an IDE controller. If manually remove that controller and make a SATA one then the disk get's attached to that instead, but the box still doesn't boot.

ubuntu/xenial64 has an IDE controller, but the two drives it has (cloudimg and cloudimg-configdrive) are attached to a SCSI controller. I manually attached a disk using this command:

vb.customize ['storageattach', :id, '--storagectl', 'SCSI Controller', '--port', 2, '--device', 0, '--type', 'hdd', '--medium', disk]

The storagecontroller output from vminfo on my vagrantmachine:

storagecontrollername0="IDE Controller"
storagecontrollertype0="PIIX4"
storagecontrollerinstance0="0"
storagecontrollermaxportcount0="2"
storagecontrollerportcount0="2"
storagecontrollerbootable0="on"
storagecontrollername1="SCSI Controller"
storagecontrollertype1="LsiLogic"
storagecontrollerinstance1="0"
storagecontrollermaxportcount1="16"
storagecontrollerportcount1="16"
storagecontrollerbootable1="on"

I've been looking at the code, but I am not sure how the patch should be. I suspect get_storage_controller should/could prefer "LsiLogic" over "(IntelAhci|PIIX4)", but attach_storage and detach_storage needs to figure out the port number somehow.

Sounds like there's currently a bit of magic that tries to guess where the image should be attached? If the magic can't cater for every situation then perhaps an easier answer would be to make it a configuration option from the Vagrantfile? So that we can just say "attach to controller 1" or whatever?

So in answer to:

attach_storage and detach_storage needs to figure out the port number somehow.

We could just tell it?

I agree, unless there's a simple way to query the next available port number.

Any updates to this? Looks like I've hit this issues as well with ubuntu/xenial64.