mirror of
https://github.com/vagrant-libvirt/vagrant-libvirt.git
synced 2025-02-25 18:55:27 -06:00
Fix Broken /etc/machine-id by vagrant package due to virt-sysprep's customize operation (#1184)
virt-sysprep by default enable the `customize` operation, which will regenerate the `/etc/machine-id` by the end of the operation. This cause all newly created VMs by `vagrant up` coming with idential `/etc/machine-id` and so receive conflicted IP from DHCP. This PR disable `customize` as per https://github.com/vagrant-libvirt/vagrant-libvirt/issues/851#issuecomment-520799720 recommendation. Fixes #851
This commit is contained in:
committed by
GitHub
parent
f53a5d8175
commit
395ab7141e
@@ -50,7 +50,7 @@ module VagrantPlugins
|
|||||||
# remove hw association with interface
|
# remove hw association with interface
|
||||||
# working for centos with lvs default disks
|
# working for centos with lvs default disks
|
||||||
options = ENV.fetch('VAGRANT_LIBVIRT_VIRT_SYSPREP_OPTIONS', '')
|
options = ENV.fetch('VAGRANT_LIBVIRT_VIRT_SYSPREP_OPTIONS', '')
|
||||||
operations = ENV.fetch('VAGRANT_LIBVIRT_VIRT_SYSPREP_OPERATIONS', 'defaults,-ssh-userdir')
|
operations = ENV.fetch('VAGRANT_LIBVIRT_VIRT_SYSPREP_OPERATIONS', 'defaults,-ssh-userdir,-customize')
|
||||||
`virt-sysprep --no-logfile --operations #{operations} -a #{@tmp_img} #{options}`
|
`virt-sysprep --no-logfile --operations #{operations} -a #{@tmp_img} #{options}`
|
||||||
# add any user provided file
|
# add any user provided file
|
||||||
extra = ''
|
extra = ''
|
||||||
|
|||||||
Reference in New Issue
Block a user