tencent cloud

Cloud Virtual Machine

Dinâmicas e anúncios
Dinâmica do produto
Dinâmica de atualização de imagem pública
Anúncio do produto
Introdução do produto
Visão geral da Cloud Virtual Machine
Vantagens do produto
Conceitos básicos
Regiões e zonas
Tutorial
Service Regions and Service Providers
Cobrança do produto
Visão geral de cobrança
Modo de cobrança
Item de cobrança
Converter modo de cobrança
Aquisição de instâncias
Descrição de cobrança de ajustes de configuração
Descrição de cobrança em atraso
Guia de início rápido
Comprar instância Linux personalizada
Comprar instância Windows personalizada
Guia do usuário
Visão geral do guia de operação
Visão geral dos limites de uso
Instância
Instância spot
Instância reservada
Imagem
Armazenamento
Backup e recuperação
Rede
Segurança
Senhas/chaves secretas
Gerenciamento de operação e manutenção
Migrar o servidor
Migração online
Consultoria de migração
Solução de falhas
Falhas relacionados ao login em instâncias Windows
Falhas relacionados ao login em instâncias Linux
Outras falhas relacionadas ao login em instâncias
Falha na execução de instância
Falha de memória em instâncias Linux
Falha de rede
Tutorial prático
Recomendações de seleção da CVM
Configurar o ambiente
Configurar o site
Configurar o aplicativo
Configurar a página visual
Carregar arquivos locais para a CVM
Teste de desempenho de rede
Outros tutoriais práticos
Segurança e conformidade
Gerenciamento de acesso
Rede
Perguntas frequentes
Regiões e zonas
Sobre o faturamento
Instância
Armazenamento
Imagem
Migração de servidor
Rede
Segurança
Operação/manutenção e monitoramento
Gerenciamento de acesso
Serviço NTP
Cenário de aplicação
Agreements
CVM Service Level Agreements
Red Hat Enterprise Linux Image Service Agreement
Public IP Service Level Agreement
Glossário
DocumentaçãoCloud Virtual Machine

Converting the Image Format

Modo Foco
Tamanho da Fonte
Última atualização: 2024-01-08 09:37:01

Overview

This document describes how to use qemu-img to convert image files to VHD or RAW format. Currently, you can import image files in RAW, VHD, QCOW2, or VMDK to Tencent Cloud CVM. Image files in other formats need to be converted before being imported.

Directions

Select the method according to the operating system of the CVM instance:
Windows
Linux
Note:
This document uses Windows 10 as an example to describe how to convert the image format. As the steps may vary by operating system, proceed based on the actual conditions.

Installing qemu-img

Download qemu-img here and install it. This document takes C:\\Program Files\\qemu as the installation path as an example.

Configuring environment variable

1. Right-Click Start and select System in the pop-up menu.
2. In the pop-up window, select Advanced system settings.
3. In the System Properties pop-up window, select the Advanced tab and click Environment Variables.
4. In the Environment Variables window, select Path in System variables and click Edit as shown below:


5. In the Edit environment variable pop-up window, click Create, enter the installation path of qemu-img C:\\Program Files\\qemu, and click OK.
6. In the Environment Variables window, click OK again.

Verifying environment variable configuration

1. Press Win + R to open the Run window.
2. In the Run window, enter cmd to open the command line.
3. Run the following command to determine whether the environment variable has been configured successfully based on the returned result:
qemu-img --help

Converting image format

1. Run the following command on the command line to switch to the directory of the image file:
cd <directory of the source image file>
2. Run the following command to convert the image format:
qemu-img convert -f <source image file format> -O <target image format> <source image filename> <target image filename>
The parameters are described as follows:
-f: source image file format.
-O (in uppercase): target image format and source and target image filenames. For example, run the following command to convert the test.qcow2 image file to test.raw:
qemu-img convert -f qcow2 -O raw test.qcow2 test.raw
After conversion, the target file will be displayed in the directory of the source image file.
Note:
This document uses Ubuntu 20.04 and CentOS 7.8 as an example to describe how to convert the image format. As the steps may vary by operating system, proceed based on the actual conditions.

Installing qemu-img

1. Run the following command to install qemu-img:
Ubuntu:
apt-get update # Update the package list
apt-get install qemu-utils # Install qemu-img
CentOS:
yum install qemu-img
2. Run the following command to convert the image format:
qemu-img convert -f qcow2 -O raw test.qcow2 test.raw
The parameters are described as follows:
-f: source image file format.
-O (in uppercase): target image format and source and target image filenames. After conversion, the target file will be displayed in the directory of the source image file.

References

Ajuda e Suporte

Esta página foi útil?

comentários