Openstack - Windows images based on qcow2 file starts 80% full? Resizing is not working? - image

I am trying to set up a Windows 7 instance on Openstack. This instance requires at least 50 GB of free disk space to run an application. When I create my windows 7 image and upload it everything works fine, except for one problem - The disk space is already 80% used when I start.
For example a windows 7 instance with a 100GB hard drive has only 18.3GB of free space.
What I tried:
I have been trying to create a windows 7 image with a 100GB hard drive. I created a QCOW2 file with a windows 7 ISO and the Virt-IO drivers ISO using the below commands:
create the empty qcow2 file:
qemu-img create -f qcow2 win_64bit_SP1_100GB.qcow2 100G
Combine the two ISOs:
sudo virt-install --connect qemu:///system --name
PS4Agent_win7_64bit_SP1_100GB --ram 2048 --vcpus 2 --network
network=default,model=virtio --disk
path=win_64bit_SP1_100GB.qcow2,format=qcow2,device=disk,bus=virtio
--cdrom /home/khennessy/win7_win8_iso_creation/SW_DVD5_Win_Pro_7w_SP1_64BIT_English_-2_MLF_X17-59279.ISO
--disk path=/home/khennessy/win7_win8_iso_creation/virtio-win-0.1-100.iso,device=cdrom
--vnc --os-type windows --os-variant win2k8 --force
I then uploaded these to Openstack using a 'minimum disk space' of 90GB, making the minimum flavor xl. (Currently trying a lower value, the images are so large it takes a long time to test anything.)
I then create an instance using this image and log into it using the 'console' view. It all works fine but when I go into 'my computer' it tells me I have only 18GB free space? I have tried 'resizing' the images but it just seems to bring them into an error state?
Can anyone help me? Thanks very much.

Before you upload your windows 7 image onto glance, you need to download CloudbaseInitSetup_x64.msi
or CloudbaseInitSetup_x86.msi] and install it on your windows7 image first. Also, don't forget to add "plugins=cloudbaseinit.plugins.windows.extendvolumes.ExtendVolumesPlugin" to the configuration file of Cloudbase-init.
You can visit and http://cloud-ninja.org/2014/05/14/running-windows-7-guests-on-openstack-icehouse/ for more information.

Related

Migrate multiple vmdk to openstack

I have a running vm in vmware environment and need to migrate that vm to openstack environment(qcow2).
I exported my virtual machine and it created 3 vmdks files, now how can I install this 3 vmdk files in to openstack environment. I have converted these 3 vmdks files to qcow2 format but how can I handle 3 qcow2 image to install my vm.
Could someone guide please?
You could try create server with --block-device-mapping, check from "Block Device Mapping in Nova".
Like this:
openstack server create --flavor FLAVOR.NAME --image qcow2.first.vmdk \
--block-device-mapping vdb=qcow2.second_1.vmdk:image \
--block-device-mapping vdc=qcow2.third_2.vmdk:image \
--nic port-id=the_port_with_same_ip_as_in_vmware \
qcow2_image_server_name
In my situation, we use ceph to provide the shared storage, so I use volume instead of the image in above command line, it works for me. I think it's similar with local disk storage like your scenario.
Another thing, I had test that ceph shared storage could transform to local disk storage with replace the disk's file by qemu-img convert, vice versa.

Resizng data disk on Alicloud

I have a production server running CentOS 6.9 on Alicloud in China. Instance is of ecs.sn1.3xlarge type. Recently one of my data disk became filled-up. So I decided to resize the volume and followed the step by step instructions available on this page: https://www.alibabacloud.com/help/doc-detail/25452.html.
Here are steps that I followed:
Resized disk form console
Rebooted system (Rebooting system didn't resized/populated disk on system)
umount disk
Run fdisk on desired disk
e2fsck -f /dev/vdb1 # check the file system
resize2fs /dev/vdb1 # resize the file system
Thank you in Advance

Docker on Windows: Error processing tar file(exit status 1): write /app/wiki.de.bin: no space left on device

I am trying to add a .bin file (name wiki.de.bin) to the docker via a DockerFile. When I try to build it, I get an error message:
Error processing tar file(exit status 1): write /app/wiki.de.bin: no space left on device.
I have done docker system prune as well as docker volume ls -qf dangling=true, however it does not help.
What should I do?
I am using Windows 10 Home which has Hyper-V available.
Here is the relevant System information.
Does it have anything to do with the fact that I have only 6.42GB available virtual memory? IF yes, how do I resolve this issue?
Did you also tried docker volume prune ?
Sometimes I have to do this and then regenerate my volumes later.

More swap space for Docker on Mac OSX Yosemite

I am trying to add more swap space in docker in order to avoid this error installing oracle database:
This system does not meet the minimum requirements for swap space.
Based on the amount of physical memory available on the system, Oracle
Database 11g Express Edition requires 2048 MB of swap space. This
system has 1023 MB of swap space. Configure more swap space on the
system and retry the installation.
I am following the instructions commented here:
https://forums.docker.com/t/docker-for-mac-configure-swap-space/20656/2
but when I execute mkswap I get "command not found":
mkswap /var/swap.file
Any idea?
Docker for Mac runs an Alpine Linux VM to host containers.
This is a prebuilt boot image that is designed for ease of use, and also updates over time so it can be hard to customise some times as most config is reset when you reboot it.
In this case you can persist a swap file change, but config like this has the possibility of changing between versions without notice. You might be better off running a custom VM for this so your swap configuration hangs around.
Docker for Mac 17.06.0
Swap is controlled by the do_swapfile function in the /etc/init.d/automount init script in the VM. If the swap file exists, it will be used as is. As the swap file is stored in /var it is persisted across reboots and can be manually customised.
Attach to the VM's tty from your mac with screen (brew install screen if you don't have it)
screen ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/tty
Then in the VM, replace the existing swap file with a new one of the required size and reboot the box. The size of the file is the block size bs * count.
swapoff -a
dd if=/dev/zero of=/var/spool/swap bs=1k count=2097152
chmod 600 /var/spool/swap
mkswap /var/spool/swap
reboot
When the VM has rebooted, you should be able to connect again and see the new size of the VM's Swap space with free.
$ screen ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/tty
/ # free
total used free shared buffers cached
Mem: 3526164 389952 3136212 165956 20968 208160
-/+ buffers/cache: 160824 3365340
Swap: 2097148 0 2097148

custom Linux kernel build failure in vmware workstation

While trying to compile/build and boot custom kernel inside vmware workstation, while booting new kernel, it fails and falls to shell with error "failed to find disk by uuid".
I tried this with both ubuntu and centos.
Things I tried but didn't help
check mapping by uuid in boot entry and existence in directory.
initramfs-update
replaced root=uuid=<> with /dev/disk/sda3
is it issue with vmware workstation?
how can it be rectified..??
I had a similar fault with my own attempts to bootstrap Fedora 22 onto a blank partition using a Centos install on another partition. I never did solve it completely, but I did find the problem was in my initrd rather than the kernel.
The problem is the initrd isn't starting LVM because dracut didn't tell the initrd that it needs LVM. Therefore if you start LVM manually you should be able to boot into your system to fix it.
I believe this is the sequence of commands I ran from the emergency shell to start LVM:
vgscan
vgchange -ay
lvs
this link helped me remember
Followed by exit to resume normal boot.
You might have to mount your LVM /etc/fstab entries manually, I don't recall whether I did or not.
Try this:
sudo update-grub
Then:
mkinitcpio -p linux
It won't hurt to check your fstab file. There, you should find the UUID of your drive. Make sure you have the proper flags set in the fstab.
Also, there's a setting in the grub.cfg that has has GRUB use the old style of hexadecimal UUIDs. Check that out as well!
The issue is with creation of initramfs, after doing a
make oldconfig
and choosing default for new options, make sure the ENOUGH diskspace is available for the image to be created.
in my case the image created was not correct and hence it was failing to mount the image at boot time.
when compared; the image size was quite less than the existing image of lower version, so I added another disk with more than sufficient size and then
make bzImage
make modules
make modules_install
make install
starts working like a charm.
I wonder why the image creation got completed earlier and resulted in corrupt image (with less size) without throwing any error [every single time]

Resources