<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>openATTIC (Posts about kvm)</title><link>/</link><description></description><atom:link href="https://openattic.org/categories/kvm.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><lastBuildDate>Thu, 22 Aug 2019 20:00:53 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>How to create a vagrant VM from a libvirt vm/image</title><link>https://openattic.org/posts/how-to-create-a-vagrant-vm-from-a-libvirt-vmimage/</link><dc:creator>Kai Wagner</dc:creator><description>&lt;div&gt;&lt;p&gt;It cost's me some nerves and time to figure out how to create a vagrant image from
a libvirt kvm vm and how to modify an existing one. Thanks to pl_rock from stackexchange
for the awesome start.&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;First of all you have to install a new vm as usual. I've installed a new vm with Ubuntu 16.04 LTS.
I'm not sure if it's really neccessary but set the root password to "vagrant", just to be sure.&lt;/li&gt;
&lt;li&gt;Connect to your VM via ssh or terminal and do the following steps.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href="https://openattic.org/posts/how-to-create-a-vagrant-vm-from-a-libvirt-vmimage/"&gt;Read more…&lt;/a&gt; (2 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>ceph</category><category>customize</category><category>kvm</category><category>libvirt</category><category>migration</category><category>vagrant</category><guid>https://openattic.org/posts/how-to-create-a-vagrant-vm-from-a-libvirt-vmimage/</guid><pubDate>Thu, 11 Jan 2018 10:52:54 GMT</pubDate></item><item><title>Reduce KVM disk size with dd and sparsify</title><link>https://openattic.org/posts/reduce-kvm-disk-size-with-dd-and-sparsify/</link><dc:creator>Kai Wagner</dc:creator><description>&lt;div&gt;&lt;p&gt;You can convert a raw or qcow2 non-sparse image to a sparse image with dd and sparsify. Or you can reduce the size of an existing image again.&lt;/p&gt;
&lt;p&gt;Install the libguestfs-tools on your system&lt;/p&gt;
&lt;blockquote&gt;
apt-get install libguestfs-tools&lt;/blockquote&gt;
&lt;p&gt;Now copy your existing image to a new one with dd&lt;/p&gt;
&lt;blockquote&gt;
dd if=existing_imagefile.raw of=new_imagefile.raw conv=sparse&lt;/blockquote&gt;
&lt;p&gt;Afterwards use virt-sparsify to reduce your disk size again (in this example I sparsed and converted the image in just one step)&lt;/p&gt;
&lt;blockquote&gt;
virt-sparsify new_imagefile.raw --convert qcow2 new_imagefile.qcow2&lt;/blockquote&gt;
&lt;p&gt;In my case I converted a block device with 65GB with dd sparse to 40GB raw image and afterwards I used virt-sparsify to reduce the size down to 6.8GB.&lt;/p&gt;&lt;/div&gt;</description><category>dd</category><category>disk</category><category>kvm</category><category>reduce</category><category>sparsify</category><category>virsh</category><category>virt</category><guid>https://openattic.org/posts/reduce-kvm-disk-size-with-dd-and-sparsify/</guid><pubDate>Tue, 01 Nov 2016 08:45:38 GMT</pubDate></item><item><title>KVM guest with acpid installed will not shutdown</title><link>https://openattic.org/posts/kvm-guest-with-acpid-installed-will-not-shutdown/</link><dc:creator>Kai Wagner</dc:creator><description>&lt;div&gt;&lt;p&gt;Yesterday a colleague migrated a physical machine into a kvm vm. Afterwards we wanted to manage the vm within virt-manager.&lt;/p&gt;
&lt;p&gt;Acpid was installed, but nothing happend if we tried to shutdown or reboot the vm via acpi requests.&lt;/p&gt;
&lt;p&gt;The problem was, that the migrated kvm vm still tought that it is a hardware instead of a vm. Therefore I changed the entry within the acpi events.&lt;/p&gt;
&lt;blockquote&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;Edit /etc/acpi/events/powerbtn to contain action=/sbin/poweroff&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;p&gt;As an alternative you could purge and reinstall the acpid package.&lt;/p&gt;
&lt;blockquote&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;apt-get purge acpid&lt;/li&gt;
&lt;li&gt;apt-get install acpid&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;p&gt;Sometimes it's that easy :-)&lt;/p&gt;&lt;/div&gt;</description><category>acpid</category><category>config</category><category>kvm</category><guid>https://openattic.org/posts/kvm-guest-with-acpid-installed-will-not-shutdown/</guid><pubDate>Tue, 30 Aug 2016 14:17:42 GMT</pubDate></item></channel></rss>