mirror of
https://github.com/vagrant-libvirt/vagrant-libvirt.git
synced 2025-02-25 18:55:27 -06:00
commit
233133b54c
@ -23,7 +23,7 @@ module VagrantPlugins
|
||||
# Create VM if not yet created.
|
||||
if !env[:result]
|
||||
b2.use SetNameOfDomain
|
||||
if !env[:machine].box
|
||||
if !env[:machine].config.vm.box
|
||||
b2.use CreateDomain
|
||||
b2.use CreateNetworks
|
||||
b2.use CreateNetworkInterfaces
|
||||
@ -77,7 +77,7 @@ module VagrantPlugins
|
||||
next
|
||||
end
|
||||
|
||||
if !env[:machine].box
|
||||
if !env[:machine].config.vm.box
|
||||
# With no box, we just care about network creation and starting it
|
||||
b3.use CreateNetworks
|
||||
b3.use SetBootOrder
|
||||
@ -171,7 +171,7 @@ module VagrantPlugins
|
||||
if !env[:result]
|
||||
# Try to remove stale volumes anyway
|
||||
b2.use SetNameOfDomain
|
||||
if env[:machine].box
|
||||
if env[:machine].config.vm.box
|
||||
b2.use RemoveStaleVolume
|
||||
end
|
||||
if !env[:result]
|
||||
|
@ -75,7 +75,7 @@ module VagrantPlugins
|
||||
@os_type = 'hvm'
|
||||
|
||||
# Get path to domain image from the storage pool selected if we have a box.
|
||||
if env[:machine].box
|
||||
if env[:machine].config.vm.box
|
||||
actual_volumes =
|
||||
env[:machine].provider.driver.connection.volumes.all.select do |x|
|
||||
x.pool_name == @storage_pool_name
|
||||
@ -89,7 +89,7 @@ module VagrantPlugins
|
||||
# If we have a box, take the path from the domain volume and set our storage_prefix.
|
||||
# If not, we dump the storage pool xml to get its defined path.
|
||||
# the default storage prefix is typically: /var/lib/libvirt/images/
|
||||
if env[:machine].box
|
||||
if env[:machine].config.vm.box
|
||||
storage_prefix = File.dirname(@domain_volume_path) + '/' # steal
|
||||
else
|
||||
storage_pool = env[:machine].provider.driver.connection.client.lookup_storage_pool_by_name(@storage_pool_name)
|
||||
@ -142,7 +142,7 @@ module VagrantPlugins
|
||||
env[:ui].info(" -- Memory: #{@memory_size / 1024}M")
|
||||
env[:ui].info(" -- Management MAC: #{@management_network_mac}")
|
||||
env[:ui].info(" -- Loader: #{@loader}")
|
||||
if env[:machine].box
|
||||
if env[:machine].config.vm.box
|
||||
env[:ui].info(" -- Base box: #{env[:machine].box.name}")
|
||||
end
|
||||
env[:ui].info(" -- Storage pool: #{@storage_pool_name}")
|
||||
|
@ -138,7 +138,7 @@ module VagrantPlugins
|
||||
@app.call(env)
|
||||
|
||||
|
||||
if env[:machine].box
|
||||
if env[:machine].config.vm.box
|
||||
# Configure interfaces that user requested. Machine should be up and
|
||||
# running now.
|
||||
networks_to_configure = []
|
||||
|
@ -81,7 +81,10 @@ fi
|
||||
|
||||
cd "$TMP_DIR"
|
||||
|
||||
IMG_SIZE=$(qemu-img info "$TMP_IMG" | grep 'virtual size' | awk '{print $3;}' | tr -d 'G')
|
||||
#Using the awk int function here to truncate the virtual image size to an
|
||||
#integer since the fog-libvirt library does not seem to properly handle
|
||||
#floating point.
|
||||
IMG_SIZE=$(qemu-img info "$TMP_IMG" | awk '/virtual size/{print int($3);}' | tr -d 'G')
|
||||
|
||||
cat > metadata.json <<EOF
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user