Giter Club home page Giter Club logo

convert_ova's Introduction

OVA to QCOW2 Converter

This script extracts a VMDK file from an OVA file and converts it to QCOW2 format for use with QEMU.

Description

The script performs the following steps:

  1. Extracts the contents of an OVA file into a specified directory.
  2. Retrieves the VMDK file from the extracted contents.
  3. Converts the VMDK file to QCOW2 format.

Prerequisites

  • Python 3.12
  • qemu-img tool installed on your system

Installation

Clone the repository and navigate to the project directory:

git clone https://github.com/NossaGTS/convert_ova.git
cd convert_ova

Usage

To run the script, use the following command:

./convert_ova.py -n <ova_name> -p <path_to_ova_file>

Arguments

  • -n, --name : The name of the OVA file (without the .ova extension).
  • -p, --path : The path to the directory containing the OVA file.

Example

./convert_ova.py -n my_ova_file -p /path/to/ova

Functions

unzip_ova(ova_path, ova_name)

Unzips an OVA file into a specified directory and retrieves the VMDK file.

Parameters:

  • ova_path (str): The path to the OVA file to be unzipped.
  • ova_name (str): The name of the OVA file, used to create the output directory.

Returns:

  • str: The name of the VMDK file extracted from the OVA file.

Raises:

  • Exception: If an error occurs during the extraction process.

convert_to_qcow(vmdk_file, ova_name)

Converts a VMDK file to QCOW2 format for use with QEMU.

Parameters:

  • vmdk_file (str): The path to the VMDK file to be converted.
  • ova_name (str): The name of the OVA file, used to create the output directory and name the resulting QCOW2 file.

Returns:

  • None

Raises:

  • Exception: If an error occurs during the conversion process.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • This script utilizes the qemu-img tool for converting VMDK files to QCOW2 format.

convert_ova's People

Contributors

nossagts avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.