- OpenStack Cloud Computing Cookbook(Third Edition)
- Kevin Jackson Cody Bunch Egle Sigler
- 284字
- 2021-07-16 20:39:17
Migrating a VMware image
We can migrate a VMware based image, vmdk
, to other disk image formats. This can be achieved using an image conversion utility. This same utility can be used to verify that the conversion worked properly. Once the image has been converted, it can be uploaded to OpenStack Image Service.
Getting ready
To begin with, ensure you are logged in to our Ubuntu client where we will be doing the image conversion. Make sure you have qemu-util
installed; if not, you may install it using the following:
sudo apt-get install qemu-utils
How to do it...
Carry out the following steps to convert a VMDK image to the QCOW2 format:
- Verify the image using the following command:
qemu-img info custom-iso-1415990568-disk1.vmdk
- You will get the following output:
image: custom-iso-1415990568-disk1.vmdk file format: vmdk virtual size: 39G (41943040000 bytes) disk size: 2.7G cluster_size: 65536 Format specific information: cid: 2481477841 parent cid: 4294967295 create type: monolithicSparse extents: [0]: virtual size: 41943040000 filename: custom-iso-1415990568-disk1.vmdk cluster size: 65536 format:
- Convert the image using the following command:
qemu-img convert -f vmdk -O qcow2 -c \-p custom-iso-1415990568-disk1.vmdk \custom-iso-1415990568-disk1.qcow2
Here,
-f
is the input disk image format,-O
is the output format,-c
target should be compressed QCOW format only), and-p
show progress. - Verify the converted image as follows and it should show that the images are identical if all went as expected:
qemu-img compare -s -f vmdk \-F qcow2 custom-iso-1415990568-disk1.vmdk \custom-iso-1415990568-disk1.qcow2 Images are identical.
How it works...
The qemu-img convert
command-line tool works on multiple formats, including VMDK. Conversion to VMDK or other desired formats would work as well. Since the QCOW format supports image compression, it can be useful to get a smaller image which then can grow.
- NLTK基礎(chǔ)教程:用NLTK和Python庫構(gòu)建機器學(xué)習(xí)應(yīng)用
- Visual Basic程序設(shè)計(第3版):學(xué)習(xí)指導(dǎo)與練習(xí)
- 深度強化學(xué)習(xí)算法與實踐:基于PyTorch的實現(xiàn)
- Python數(shù)據(jù)可視化之Matplotlib與Pyecharts實戰(zhàn)
- Flux Architecture
- C++ 從入門到項目實踐(超值版)
- 劍指MySQL:架構(gòu)、調(diào)優(yōu)與運維
- Java實戰(zhàn)(第2版)
- Microsoft 365 Certified Fundamentals MS-900 Exam Guide
- 軟件項目管理實用教程
- SignalR:Real-time Application Development(Second Edition)
- CodeIgniter Web Application Blueprints
- JQuery風(fēng)暴:完美用戶體驗
- Learning WordPress REST API
- 零基礎(chǔ)PHP從入門到精通