Comments (8)
Thanks for the update. During the build there's 2 cdroms in use (1 for the OS and the other for VM tools), where only 1 is required in the VM template. In the docs, maybe I misunderstood the process. Remove cdroms and then keep only 1 for final config. So the correct process is to not remove cdroms and just use reattach_cdroms? It is confusing.
Well, I do not seem to see at all reattach_cdrom
being documented on the hashicorp site. I think they haven't uploaded the docs last few releases. For now there's documentation in the repo and it says, quoting:
When set to a value in the range (
1..4
, remark is mine),remove_cdrom
is ignored and the CD-ROM devices are kept without any attached media.
So the interaction with remove_cdrom
is documented and it says the option is just ignored (although in the code it actually isn't, which resulted in this bug, but as far as a user concerned there's no visible difference in the option behavior when reattach_cdrom
is set as well).
Perhaps the variable should simply be retain_cdroms = # (to specify how many to be left in the template) ?
I think retain
would be misleading, because it implies that some amount of cdroms would see no changes. Which is not true, because the code does some change: specifically, it deattaches ISO files from them.
from packer-plugin-vsphere.
@Hi-Angel to triage.
from packer-plugin-vsphere.
Oh, I see, thank you. I'll have to dig into it, so I'll probably take a look into it tomorrow or on Friday at worst.
from packer-plugin-vsphere.
Took a quick look into it. It's a funny bug: the reason the problem happens is because in step_reattach_cdrom.go
we expect the number of cdroms to be equal to s.CDRomConfig.ISOPaths
. However, it does not take into account the existence of remove_cdrom = true
HCL option which would remove remove cdroms, thus making this assumption invalid.
Possible solutions I see:
- Get the actual number of CDroms from the API
- In
step_reattach_cdrom.go
take into accountremove_cdrom
- In
remove_cdrom
processing take into accountreattach_cdroms
1
seems like the best one, except Idk offhand what API should I use and wouldn't it make request over the network (which isn't good).
2
I tried and there does not seem to be access to remove_cdrom
value in step_reattach_cdrom.go
file.
3
I didn't try yet, but I presume the problem would be similar to 2
(i.e. having to access to reattach_cdroms
in wherever the remove_cdrom
is processed).
from packer-plugin-vsphere.
Okay, got a fix locally by adding a function enlisting cdrom devices, which is the best way to handle that I think. But it doesn't quite work + I guess I need to add tests for that case as well, so it will take some more time.
from packer-plugin-vsphere.
@StephenSo thank you for finding the bug! Its fix is being reviewed at #394
That said, I just wanted to mention that you can make it work without waiting for the fix to get merged by removing the remove_cdrom
line from the config. I don't see the point of removing the cdroms if you want them immediately to be readded. Reattached cdroms should have no flies attached to them in case that's what you were afraid of. As it stands, the option is just excess code for you to read and for your server to execute 😊
from packer-plugin-vsphere.
from packer-plugin-vsphere.
Thanks @Hi-Angel, I will remove the use of remove_cdrom
from my code. I will test and revert if it breaks the build.
from packer-plugin-vsphere.
Related Issues (20)
- vTPM is not required to enable VBS. HOT 4
- Missleading documentation: `disk_size` is in MiB not in MB HOT 4
- Add support for adding a precision clock device
- Uploaded cdrom iso is not cleaned up from remote packer_cache directory HOT 1
- `vsphere-clone`: Support Template Files for Windows Sysprep
- `vsphere-iso` : problem with VMX `bios.hddOrder` and `bios.bootOrder` with EFI HOT 5
- `vsphere-iso`: `ip_settle_timeout` does not honor values beyond 25m/1500s HOT 5
- Boot order frozen despite code change HOT 1
- Help with OUPath field on AD join HOT 2
- Firmware and boot issues HOT 1
- guest_os_type possible values link broken HOT 2
- 1.2.5 No longer builds Windows 2019 & 2022 HOT 8
- Add support to set template name during post-processing HOT 1
- Packer boot_command remains as default kernel boot command in /etc/default/grub causing problems with cloud init HOT 9
- `vsphere-clone` with `none` communicator does not start the vm, and proceeds to export after configuration HOT 7
- Add support for serial ports
- IP address gets changed after reboot (not always) when building using vsphere - no route to host ssh HOT 14
- Add support to import OVF template from URL in supervisor builder
- Crash when connecting with `insecure_connection=false` HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from packer-plugin-vsphere.