Convert openVZ container to VMware - vmware

I'm trying to convert an openVZ container to VMware.
Since this is planned for roughly 1000 instances, I'm looking for a different approach than reinstalling from scratch.
I followed the steps in the last post:
https://communities.vmware.com/message/1719787#1719787
However, when booting from a live CD, it can't find any linux partition.
I also tried yum install kernel-xx which had no effect on the live CD not finding a partition so I'm assuming there's an error while converting.
Does anyone know of a solution or some tweaks to the one I posted?
The OS in this case is CentOS 7 on openVZ 6.

Long story short: Convert openVZ to KVM, then convert to VMWare.
create a KVM with the same OS as your container
mount the KVM image file
rsync all data to that image file
umount image file and start and stop KVM
convert img to vmdk with qemu-img
move vmdk file to esxi host
convert to thin-provisioned vmdk with vmkfstools
I had to tackle (and still am) multiple issues to make it boot, like recrating initrams, reinstalling policykit, reconfiguring networking, adjusting grub.
Hope this helps someone.

It looks like you will have to go the OpenVZ -> KVM -> VMware route. This post by Roman Pertl explains how he did it, plus it also links to some other tutorials.

rsync --exclude=/var/lib/initramfs-tools/* --exclude=/var/lock --exclude=/etc/fstab --exclude=/etc/modules --exclude=/etc/mtab --exclude=/boot/* --exclude=/proc/* --exclude=/lib/modules/* --exclude=/tmp/* --exclude=/dev/* --exclude=/sys/* -e ssh --delete-after --numeric-ids -avpogtStlHz / root#sourcevm:22/

Related

Migrating KVM guest to VMware: stuck on Error Recovery screen

I'm trying to move an old Win2008 server from KVM to VMware ESXi 6.7.
I realize the Win2008 VM is old and beyond EoS but need to keep this in place for now and is in a VLAN that is not internet accessible.
I tried to follow recommendations from Convert qcow2 to vmdk and make it ESXi 6.0 Compatible and steps I found on the web:
Shutdown VM on KVM
qemu-img convert -p -f qcow2 -O vmdk win2008.qcow2 win2008.vmdk using qemu v4.2.1
vmkfstools -i win2008.vmdk -d thin win2008_v2.vmdk on the VMware host
Attach the newly created win2008_v2.vmdk file to a newly created guest with default settings
However I'm stuck with a Windows Error Recovery: Windows failed to start. A recent hardware or software change might be the cause. screen at boot up.
I tried to use some conversion options like qemu-img convert -p -f qcow2 -O vmdk -o adapter_type=lsilogic,subformat=streamOptimized,compat6 win2008.qcow2 win2008.vmdk and tried moving between the 3 available scsi controllers (LSI Logic SAS, LSI Logic Parallel, VMware Paravirtual) to no avail.
When I boot the guest in Safe mode, I see a bunch of sys files get loaded properly until it's stuck after Loaded: \Windows\system32\drivers\crcdisk.sys.
Does anyone have an idea on how to move this guest properly? Any other conversion options to try? Driver install on the running guest (in KVM) first?
Note I'm not running vCenter.
Do you try to use VMware Converter Tool ? I think that is the easy way to move your server to VMware. You can download the tool it is free.
https://www.vmware.com/products/converter.html

Does stopping google cloud instance will loose the installed programs on it ?

I have recently initialized a GPU instance on Google cloud, and installed Anaconda and installed all required dependencies before I stoped that instance. Now when I started the instance, it does not have anaconda installed in it. I found it is so weird. Please let me know if you know any details on it. I also looked into details from the doc of google, I don't find any related comments that should behave like this.
https://cloud.google.com/compute/docs/instances/stopping-or-deleting-an-instance
No, this should not happen if programs got installed properly in persistent/boot disk file system.
If programs are supposedly installed in TMPFS or other memory mapped file system then after the instance is rebooted the memory contents would be lost and consequently data and links to it.
However, this is never done as VM Instance packages are installed in persistent disk.
I guess your installation failed for some reason. Check if the packages are still installed. If you are using a Redhat Linux variant you can use ‘yum list installed’ to see all installed packages or ‘yum list installed|grep -i <package-to-search-for> to filter out a particular package.
If the package shows up, then the issue could be related to a misconfiguration or other problem somewhere. Use dmesg and/or cat /var/log/messages to view the logs and try to find any problems there which may be related to Anaconda or GPU software.
I just encountered the same problem. I know this question is dated but might help a complete beginner like myself. In my case I needed to SSH onto the instance instead of just being in the project level virtual environment.
gcloud beta compute ssh --zone "europe-west2-c" "myinstancename" --project "fired-brimstone-234534"

How I can install AsteriskNOW on Amazon EC2?

I have a question about asterisk, I know that I can install asterisk on EC2, but my questions is:
Its possible install AsteriskNOW on Amazon EC2? if not, why? and where its the best possible server or solution for install this
thanks
AsteriskNow is a complete distribution based on CentOS available as an ISO file. There doesn't appear to be an EC2 AMI available for it so you would have to build an image yourself.
Here's an overview of the process for Oracle Linux which boils down to:
Install AsteriskNow onto a VirtualBox or VMWare instance locally.
Configure all the EC2 specifics (This is the fiddly bit)
Export that virtual machine as a VMDK.
Copy the VMDK to S3
Import the VMDK to an EBS volume and launch on Amazon EC2.
Before you export you will have to make sure AsteriskNow has a kernel that supports EC2. In CentOS this would be the Xen kernel but I don't know if Asterisk would supply one, which means compiling. The PV-GRUB docco also covers a lot of what can and can't be used on EC2. If it doesn't work out of the box it will take some Linux smarts to figure it all out.
It will probably take a number of exports/imports to get it running. Once you have it up on EC2 you can turn that instance into an AMI to quickly create clones in the future without going through the whole export/import process.
can you not just download the ISO directly?
ubuntu#ip-172-31-14-19:~/iso$
ubuntu#ip-172-31-14-19:~/iso$ wget -v https://downloads.asterisk.org/pub/telephony/asterisk-now/AsteriskNow-1013-current-64.iso
--2017-11-17 05:52:53-- https://downloads.asterisk.org/pub/telephony/asterisk-now/AsteriskNow-1013-current-64.iso
Resolving downloads.asterisk.org (downloads.asterisk.org)... 76.164.171.238, 2001:470:e0d4::ee
Connecting to downloads.asterisk.org (downloads.asterisk.org)|76.164.171.238|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1343909888 (1.3G) [application/x-iso9660-image]
Saving to: ‘AsteriskNow-1013-current-64.iso’
AsteriskNow-1013-curr 100%[======================>] 1.25G 1.79MB/s in 9m 54s
2017-11-17 06:02:48 (2.16 MB/s) - ‘AsteriskNow-1013-current-64.iso’ saved [1343909888/1343909888]
ubuntu#ip-172-31-14-19:~/iso$
https://downloads.asterisk.org/pub/telephony/asterisk-now/

Why does vagrant use vmdk disk format as its standard package format?

I have a MacBook Air and space is a premium. I have a vagrant instance which has been growing in size from 2 GB to 8 GB.
I was looking at options for reducing the disk size found a few tutorials for VDI, but the actual file is a .vmdk file. Unfortunately, the tool to manage vmdk files is a commercially licensed tool from VMware.
Why does vagrant use the vmdk format as its default packaging format?
Is there a way to configure the vagrantfile and force it to use vdi instead of vmdk?
Simple answer is no.
VirtualBox only supports exporting images as OVF/OVA.
Vagrant 1.0.x base boxes are basically tar files of the VirtualBox exports. It changed a little bit in 1.1.x and 1.2+.
Anyway, technically you should still be able to convert the VMDK to VDI but you will have to re-attach it to the existing VM or create a new one using it, e.g.: VBoxManage clonehd in.vmdk out.vdi --format VDI
Refer to http://docs.vagrantup.com/v2/boxes/format.html
In the past, boxes were just tar files of VirtualBox exports. With Vagrant supporting multiple providers, box files are now tar files where the contents differ for each provider. They are still tar files, but they may now optionally be gzipped as well.
Box files made for Vagrant 1.0.x and VirtualBox continue to work with Vagrant 1.1+ and the VirtualBox provider.

Looking for Virtual PC or VMware Guest O/S with Linux already installed

I wanted to play around with Linux and do some testing. I've tried installing Linux on a Virtual PC (2004) guest but couldn't get it to work.
I figured with all the folks out there proselytizing about Linux maybe someone had made an guess file that I could just download and open up in Virtual PC (ideally) or VmWare.
PS - I asked question on ExpertsExchange about 2 years ago and all I got was people telling me I should use VMware (but not suggestions of where to find a pre-made Guest record.)
The VMWare library of pre-installed guests is at http://www.vmware.com/appliances/ - it seems to be currently down for maintenance though.
VMware player: http://www.vmware.com/products/player/
Vmware images: http://www.vmware.com/appliances/
The appliances website was down for me, but you can download premade images of various operating systems and run them using the vmware player or vmware server.
Ubuntu 8.04: http://www.vmware.com/appliances/directory/1224
Also, just look at the popular section on the right-hand side. I have found that when you want to use Linux, vmware is the way to go. I have had issues trying to install it on virtual pc, but that might have changed since I tried it back in 2006 with Fedora.
The VMWare appliance site is down as I write this but there is a very useful appliance that is about 60K that allows you to mount an ISO as a VM.
This is great because you don't have to install the distribution in a VM. You can load up the ISO into the VM every time as new or simply reload a suspended image.
When you feel comfortable - try installing the version of Linux in the VM.
You could also simply burn an ISO to a CD/DVD and boot it up to play with it - no install required.
You should also take a look at Sun's VirtualBox VM manager. Its free and pretty good.
Try http://elasticserver.com/
They have a a la carte approach for linux VM's.
Virtual Hosted Linux is a pain. If you MUST do this, then use Sun's VirtualBox - it starts up faster and really is easier to use than anything else .. You can get Ready To Use VDI images from VirtualBoxImages too... But, if you just wanna 'play around' with linux, then why not boot up a LiveCD ..