Functions and classes for image transfer between ESX/VC & image service.
Bases: eventlet.queue.LightQueue
Producer-Consumer queue to share data between reader/writer threads.
Read data from the queue.
This method blocks until data is available. The input chunk size is ignored since we have ensured that the data chunks written to the pipe by the image reader thread is the same as the chunks asked for by the image writer thread.
Set the file’s current position at the offset.
This method throws IOError since seek cannot be supported for a pipe.
Get the current file position.
Write data into the queue.
Parameters: | data – data to be written |
---|
Bases: object
Task which reads data from the input file and writes to the output file.
This class defines the task which copies the given input file to the given output file. The copy operation involves reading chunks of data from the input file and writing the same to the output file.
Start the file read - file write task.
Returns: | the event indicating the status of the read-write task |
---|
Stop the read-write task.
Wait for the file read-write task to complete.
This method returns True if the read-write thread completes successfully. In case of error, it raises ImageTransferException.
Raises: | ImageTransferException |
---|
Bases: object
Class to write the image to the image service from an input file.
This is a NOP.
Start the image write task.
Returns: | the event indicating the status of the write task |
---|
Stop the image writing task.
Wait for the image writer task to complete.
This method returns True if the writer thread completes successfully. In case of error, it raises ImageTransferException.
:raises ImageTransferException
Copy virtual disk from VMware server to the given write handle.
Parameters: |
|
---|---|
Raises: | VimException, VimFaultException, VimAttributeException, VimSessionOverLoadException, VimConnectionException, ImageTransferException, ValueError |
Download flat image from the image service to VMware server.
Parameters: |
|
---|---|
Raises: | VimConnectionException, ImageTransferException, ValueError |
Transfer an image to a datastore.
Parameters: |
|
---|
Download stream optimized data to VMware server.
Parameters: |
|
---|---|
Returns: | managed object reference of the VM created for import to VMware server |
Raises: | VimException, VimFaultException, VimAttributeException, VimSessionOverLoadException, VimConnectionException, ImageTransferException, ValueError |
Download stream optimized image from image service to VMware server.
Parameters: |
|
---|---|
Returns: | managed object reference of the VM created for import to VMware server |
Raises: | VimException, VimFaultException, VimAttributeException, VimSessionOverLoadException, VimConnectionException, ImageTransferException, ValueError |
Upload the VM’s disk file to image service.
Parameters: |
|
---|---|
Raises: | VimException, VimFaultException, VimAttributeException, VimSessionOverLoadException, VimConnectionException, ImageTransferException, ValueError |