mirror of
https://github.com/OpenNebula/one.git
synced 2024-12-25 23:21:29 +03:00
more bugs in image handling
This commit is contained in:
parent
a8fedc350b
commit
4823b0b5d1
@ -35,6 +35,7 @@ if !(vm_id=ARGV[0])
|
|||||||
exit -1
|
exit -1
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
client = Client.new()
|
client = Client.new()
|
||||||
|
|
||||||
vm = VirtualMachine.new(
|
vm = VirtualMachine.new(
|
||||||
@ -57,14 +58,15 @@ vm.each('TEMPLATE/DISK') do |disk|
|
|||||||
client)
|
client)
|
||||||
|
|
||||||
result = image.info
|
result = image.info
|
||||||
exit -1 if !is_successful?(result)
|
exit -1 if OpenNebula.is_error?(result)
|
||||||
|
|
||||||
# Disable the Image for a safe overwriting
|
# Disable the Image for a safe overwriting
|
||||||
image.disable
|
image.disable
|
||||||
|
|
||||||
# Save the image file
|
# Save the image file
|
||||||
result = image.move(source_path, image['SOURCE'])
|
result = image.move(source_path, image['SOURCE'])
|
||||||
exit -1 if !is_successful?(result)
|
|
||||||
|
exit -1 if OpenNebula.is_error?(result)
|
||||||
|
|
||||||
image.enable
|
image.enable
|
||||||
end
|
end
|
||||||
|
@ -349,7 +349,7 @@ Commands:
|
|||||||
|
|
||||||
* save (Set the specified vm's disk to be saved, overwriting the original image
|
* save (Set the specified vm's disk to be saved, overwriting the original image
|
||||||
when the vm shutdowns)
|
when the vm shutdowns)
|
||||||
onevm saveas <vm_id> <disk_id>
|
onevm save <vm_id> <disk_id>
|
||||||
|
|
||||||
* delete (Deletes a VM from the pool and DB)
|
* delete (Deletes a VM from the pool and DB)
|
||||||
onevm delete <vm_id>
|
onevm delete <vm_id>
|
||||||
@ -751,7 +751,7 @@ when "save"
|
|||||||
|
|
||||||
image_id = vm["TEMPLATE/DISK[DISK_ID=\"#{disk_id}\"]/IMAGE_ID"]
|
image_id = vm["TEMPLATE/DISK[DISK_ID=\"#{disk_id}\"]/IMAGE_ID"]
|
||||||
|
|
||||||
result = vm.save_as(disk_id.to_i, image_id)
|
result = vm.save_as(disk_id.to_i, image_id.to_i)
|
||||||
|
|
||||||
when "show"
|
when "show"
|
||||||
check_parameters("get_info", 1)
|
check_parameters("get_info", 1)
|
||||||
|
@ -102,6 +102,10 @@ module OpenNebula
|
|||||||
@immanager.copy(path, source)
|
@immanager.copy(path, source)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def move(path, source)
|
||||||
|
@immanager.move(path, source)
|
||||||
|
end
|
||||||
|
|
||||||
def mk_datablock(size, fstype, source)
|
def mk_datablock(size, fstype, source)
|
||||||
rc = @immanager.dd(size, source)
|
rc = @immanager.dd(size, source)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user