search for: create_volume

Displaying 20 results from an estimated 23 matches for "create_volume".

2010 Mar 30
3
[PATCH 1/2] Refactor guest and volume creation into Sys::VirtV2V::Target::LibVirt
...+ my $class = shift; + my ($pool, $name, $size) = @_; + + my $vol_xml = " + <volume> + <name>$name</name> + <capacity>$size</capacity> + </volume> + "; + + my $vol; + eval { + $vol = $pool->create_volume($vol_xml); + }; + die(user_message(__x("Failed to create storage volume: {error}", + error => $@->stringify()))) if ($@); + + return $class->_new($vol); +} + +sub _get +{ + my $class = shift; + my ($pool, $name) = @_; + + my $vol; + ev...
2010 Apr 06
1
[PATCH] LocalCopy: Use blockdev to get the size of block devices
...Transfer/LocalCopy.pm @@ -17,6 +17,7 @@ package Sys::VirtV2V::Transfer::LocalCopy; +use POSIX; use File::Spec; use File::stat; @@ -79,7 +80,36 @@ sub transfer path => $path, error => $!))); - my $vol = $target->create_volume($name, $st->size); + my $size; + + # If it's a block device, use the output of blockdev command + if (S_ISBLK($st->mode)) { + my $blockdev; + open($blockdev, '-|', 'blockdev', '--getsize64', $path) + or die("Unable to execute...
2010 Apr 22
2
[PATCH 1/2] Try to load the loop module before running mkinitrd
mkinitrd needs to mount files using loop. loop might be a module, so try to load it first. --- lib/Sys/VirtV2V/GuestOS/RedHat.pm | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/lib/Sys/VirtV2V/GuestOS/RedHat.pm b/lib/Sys/VirtV2V/GuestOS/RedHat.pm index 0e469f5..08027b6 100644 --- a/lib/Sys/VirtV2V/GuestOS/RedHat.pm +++ b/lib/Sys/VirtV2V/GuestOS/RedHat.pm @@ -1114,6
2010 Jun 07
1
[PATCH] ESX: Fix storage URL if storage has a snapshot
...to create the volume before writing to it. If the volume creation # takes a very long time, the transfer may fail in the mean time. - my $r = $self->head($url); - if ($r->is_success) { - $self->verify_certificate($r) unless ($self->{_v2v_noverify}); - $self->create_volume($r); - } else { - $self->report_error($r); + my $retried = 0; + SIZE: for(;;) { + my $r = $self->head($url); + if ($r->is_success) { + $self->verify_certificate($r) unless ($self->{_v2v_noverify}); + $self->create_volume($r); +...
2010 Apr 28
3
Fix 2 issues in ESX transfer
We were seeing 100% failure rates transferring 10G disk images from ESX on a particular setup. We also weren't spotting the transfer failure, and dying with a strange error from libguestfs. These 2 patches fix the error check which should have made it obvious what was failing, and the underlying error.
2010 Sep 21
1
[PREVIEW ONLY] Refactor data transfer code
...- my $class = shift; - my ($pool, $name, $size) = @_; - - my $vol_xml = " - <volume> - <name>$name</name> - <capacity>$size</capacity> - </volume> - "; - - my $vol; - eval { - $vol = $pool->create_volume($vol_xml); - }; - die(user_message(__x("Failed to create storage volume: {error}", - error => $@->stringify()))) if ($@); - - return $class->_new($vol); -} - -sub _get -{ - my $class = shift; - my ($pool, $name) = @_; - - my $vol; - ev...
2016 May 04
2
Re: [libvirt] Creating a storage volume for raw format file
...e to the file already existing. however if I try to create the storage pool then copy the file to the directory it fails to create the storage pool because the file does not exist. I figured out that if I create the file in another directory then create the storage volume as follows... def create_volume(self, vol_name, src_path): def create_vol_xml(name, src): xml = """<volume type='file'> <name>{name}</name> <allocation unit='bytes'>{allocation}</allocation>...
2010 Mar 22
1
[PATCH] ESX: Enable verification of SSL certificates
....$Sys::VirtV2V::VERSION, @@ -65,7 +65,7 @@ sub new { my ($response, $self, $h) = @_; if ($response->is_success) { - $self->verify_certificate($response) if ($verify); + $self->verify_certificate($response) unless ($noverify); $self->create_volume($response); } }); @@ -75,14 +75,14 @@ sub new { $self->{_v2v_username} = $username; $self->{_v2v_password} = $password; - if ($verify) { + if ($noverify) { + # Unset HTTPS_CA_DIR if it is already set + delete($ENV{HTTPS_CA_DIR}); + } else {...
2010 Apr 29
2
[PATCH 1/2] SSH: Check for complete transfer of disk images
...+++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/lib/Sys/VirtV2V/Transfer/SSH.pm b/lib/Sys/VirtV2V/Transfer/SSH.pm index 3b08716..ac5a384 100644 --- a/lib/Sys/VirtV2V/Transfer/SSH.pm +++ b/lib/Sys/VirtV2V/Transfer/SSH.pm @@ -82,6 +82,7 @@ sub transfer my $vol = $target->create_volume($name, $size); $vol->open(); + my $written = 0; for (;;) { my $buffer; # Transfer in 8k chunks @@ -93,10 +94,16 @@ sub transfer last if ($in == 0); $vol->write($buffer); + $written += length($buffer); } $vol->close();...
2016 May 04
0
Re: [libvirt] Creating a storage volume for raw format file
...h() and libvirt will notice the new volume and it will show up in listVolumes. createXML is only for telling libvirt to create an entirely new disk image (likely by invoking qemu-img), not to teach it about an existing image... that's what pool.refresh() is essentially for - Cole > def create_volume(self, vol_name, src_path): > def create_vol_xml(name, src): > xml = """<volume type='file'> > <name>{name}</name> > <allocation unit='bytes'>{allocation}</allocation...
2010 Apr 26
2
[PATCH] Fix virt-v2v exit codes
...rmdir($self->{mountdir}) @@ -456,6 +464,8 @@ sub DESTROY "{dir}: {error}", dir => $self->{mountdir}, error => $!)); + + $? = $retval; } =item create_volume(name, size) diff --git a/v2v/virt-v2v.pl b/v2v/virt-v2v.pl index 15d0d5b..7951303 100755 --- a/v2v/virt-v2v.pl +++ b/v2v/virt-v2v.pl @@ -350,6 +350,9 @@ exit(0); # We should always attempt to shut down the guest gracefully END { close_guest_handle(); + + # die() sets $? to 255, which is u...
2010 Feb 18
2
[PATCH 1/2] ESX: Look harder for potential transfer failures
...a my $volfh = $self->{_v2v_volfh}; + $self->{_v2v_received} += length($data); + syswrite($volfh, $data) or die(user_message(__x("Error writing to {path}: {error}", path => $self->{_v2v_volpath}, @@ -205,6 +216,7 @@ sub create_volume unless (defined($name)); my $size = $response->content_length(); + $self->{_v2v_volsize} = $size; my $vol_xml = " <volume> -- 1.6.6
2016 May 04
2
[libvirt] Creating a storage volume for raw format file
Hi I'm trying to create a volume in an existing storage pool using python by calling createXML() on the pool object. If the file that is the subject of the new volume exists you get and error, also if it doesn't exist I worked out that specifying <source> <path>path to copy of file</path> </source> works, seemingly by copying the 'source' file to
2010 Apr 09
1
[PATCH] Add SSH transfer method
...= $conn->{username}; + my $password = $conn->{password}; + my $host = $conn->{hostname}; + + die("URI not defined for connection") unless (defined($uri)); + + my ($pid, $size, $fh, $error) = + _connect($host, $username, $path); + + my $vol = $target->create_volume($name, $size); + $vol->open(); + + for (;;) { + my $buffer; + # Transfer in 8k chunks + my $in = sysread($fh, $buffer, 8 * 1024); + die(user_message(__x("Error reading data from {path}: {error}", + path => $path, +...
2010 Jan 29
4
[FOR REVIEW ONLY] ESX work in progress
The following patches are where I'm currently at with ESX support. I can now import a domain from ESX along with its storage. Note that I'm not yet doing any conversion. In fact, I've never even tested past the import stage (I just had an exit in there). The meat is really in the 4th patch. The rename of MetadataReader->Connection was because the Connection is now really providing
2010 Mar 31
1
[PATCH] Add LocalCopy transfer method to transfer local files to a target
...=> $path, + error => $!))); + + my $st = stat($fh) + or die(user_message(__x("Unable to stat {path}: {error}", + path => $path, + error => $!))); + + my $vol = $target->create_volume($name, $st->size); + $vol->open(); + + for (;;) { + my $buffer; + # Transfer in block chunks + my $in = sysread($fh, $buffer, $st->blksize); + die(user_message(__x("Error reading data from {path}: {error}", + path =&gt...
2010 Feb 01
9
[ESX support] Working ESX conversion for RHEL 5
With this patchset I have successfully[1] imported a RHEL 5 guest directly from ESX with the following command line: virt-v2v -ic 'esx://yellow.marston/?no_verify=1' -op transfer RHEL5-64 Login details are stored in ~/.netrc Note that this is the only guest I've tested against. I haven't for example, checked that I haven't broken Xen imports. Matt [1] With the exception of
2009 Oct 12
1
First draft: node storage admin
This patch provides the ability to create a "dir" type storage pool, and to add and remove volumes for existing pools.
2009 Oct 27
1
Storage admin patches
This set of patches supercedes the previous set, and has been rebased with changes from upstream.
2009 Nov 09
1
Rebased again...
This patch again rebases on upstream and should apply on next as of right now.