-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Allows for the mounting of ISOs when a Proxmox VM is created. Useful … #9055
Allows for the mounting of ISOs when a Proxmox VM is created. Useful … #9055
Conversation
…if (for example) creating a Windows VM.
Hi @jahmelharris, One option would be looking at generalising the What are your thoughts? |
Hi @carlpett. I think upload is a good idea, but i'm not sure whether it makes sense to merge everything ISO related. While it makes sense in theory, as the proxmox API doesn't support creating multiple CD or disk drives when creating a VM, in my mind they're separate steps. Create VM; add drives. I'll look at adding the ability to upload ISOs and submit another PR. |
@jahmelharris Yes, when interacting with the Go library to create the VM, they will indeed need to be separated. However, the library has quite a few warts that we should try to avoid letting guide what we expose to the Packer user. At some point, it might be swapped (hopefully), and then it'd be sad to have to be "wart compatible". I think it should mainly come down to if the configuration is better either way? Think out loud a bit, I guess it'd end up something like these two options: "iso_file": "local:iso/foo.iso",
"additional_iso_files": [
{
"device": "sata1",
"iso_file": "local:iso/bar.iso"
}
] vs "iso_files": [
{
"device": "special-boot?",
"iso_file": "local:iso/foo.iso",
},
{
"device": "sata1",
"iso_file": "local:iso/bar.iso"
}
] And from this look, keeping them separate does makes a bit more sense to me. Since there's special handling of the boot iso, it'd actually make the config a bit confusing. |
If this feature will be used to build Windows images, then the CD-ISO is not the correct option, because we cannot know the letter that Windows will assign to the CD drive. In contrast, a floppy disk always has the letter ** A **. Following the configuration set by the QEMU builder, a ** floppy_files ** key is the ideal choice. The autounattend.xml needs to know the drive letter to load the drivers. <component name="Microsoft-Windows-PnpCustomizationsWinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<DriverPaths>
<PathAndCredentials wcm:keyValue="1" wcm:action="add">
<Path>A:\</Path>
</PathAndCredentials>
</DriverPaths>
</component> The QEMU template needs: |
From what I could see when looking into this, proxmox doesn't support floppy disks (via the API). I see what you're saying about drive letters, but should it be a problem that packer tries to solve? If i'm building a Windows image, I should know what the driver letters would be and can use them appropriately. |
You cant know before hand the letter assigned by windows, but now that i think of it, i can replace the "Path" With a simple dot making the drivers relative to the autounattend location. |
@jahmelharris I lost track of this one, sorry. From what I can tell, there's a build failure that needs to be addressed, at least. Would you mind adding the uploads/ejection in this PR? Since the Packer releases aren't paced based on the state of the Proxmox builder (as long as it builds), we'll risk releasing this feature half-complete otherwise. |
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.
Some naming things
@@ -60,6 +60,8 @@ type Config struct { | |||
|
|||
shouldUploadISO bool | |||
|
|||
CDDrive []storageConfig `mapstructure:"cd_drive"` |
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.
Can we rename this something like additional_iso_files
?
@@ -81,6 +83,10 @@ type vgaConfig struct { | |||
Type string `mapstructure:"type"` | |||
Memory int `mapstructure:"memory"` | |||
} | |||
type storageConfig struct { | |||
BUS string `mapstructure:"bus"` |
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 should be a device, not a bus
Hi @jahmelharris just wanted to follow up on the changes requested by @carlpett. Do you have any questions? Please let us know if you still have bandwidth to work on this feature and if there is anything we can do to help push the PR forward. Thanks again for the contribution. |
Hi @nywilken. Unfortunately life got in the way, but will aim to pick this up again next week. I'll keep you updated. |
Should I close this PR for now? |
Closing since it's been a month with no activity. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Allows for the mounting of additional ISOs when the VM is created. A new config option has been created which allows users to specify an array of bus names and filenames.
"cd_drive": [
{
"bus": "sata1",
"filename": "disk-images:iso/kali-linux-mate-2018.4-amd64.iso"
},
{
"bus": "sata2",
"filename": "disk-images:iso/unattended-winserver.iso"
}
],
Closes #7950