-
Notifications
You must be signed in to change notification settings - Fork 1
Hcsshim Supporting Split Disk #20
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
base: private-peek
Are you sure you want to change the base?
Hcsshim Supporting Split Disk #20
Conversation
| } | ||
| } | ||
|
|
||
| func (vm *VirtualMachineSpec) GetDiskInformation(diskPath string) (controlNumber int, err error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| } | ||
| } | ||
|
|
||
| func (vm *VirtualMachineSpec) GetDiskInformation(diskPath string) (controlNumber int, err error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| return 0, err | ||
| } | ||
|
|
||
| for lun := 0; lun < 256; lun++ { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as far as i can tell there is no way to find the next free lun though any hcs/hcsshim calls. unless we want to make a sperate service to track the lun for each vm we create, we will have to get it through trial and error. The spec will not help us in this case since it is not stored anywhere and will not be populated if we call the GetVirtualMachineSpec function to retrieve the VirtualMachineSpec struct. I can start the lun count at 2 since 0 and 1 are required for creation.
| return 0, errors.New("diskpath not found in attached devices") | ||
| } | ||
|
|
||
| func (vm *VirtualMachineSpec) AttachVhd(vhdPath string) (lun int, err error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This allows the hcsshim to create a configuration spec that includes additional disks at creation. This should be used for disks that are required for the image to boot. Functions for attaching/detaching disks is a given vm is included. A command for getting the lun of a attach disk is also included, however this has the condition that only the initial creator of the spec is able to use it properly. This is because the current hcsshim will not retrieve the spec when spec when getting the VirtualMachineSpec from a VMID. see getHcsSpec to see why. As far as I can tell there is not way to get this spec from the hcs functions either.