标签:openstack libvirt qemu kvm nova
今天收到短信报警 报openstack某个节点上空间不足 登录机器一看还49G 猜想当时应该设置的是少于50G报警 1、先查看下当前硬盘空间信息 df -Th Filesystem Type Size Used Avail Use% Mounted on /dev/sda1 ext4 46G 11G 34G 24% / udev devtmpfs 7.8G 4.0K 7.8G 1% /dev tmpfs tmpfs 3.2G 292K 3.2G 1% /run none tmpfs 5.0M 0 5.0M 0% /run/lock none tmpfs 7.9G 0 7.9G 0% /run/shm none tmpfs 100M 0 100M 0% /run/user cgroup tmpfs 7.9G 0 7.9G 0% /sys/fs/cgroup /dev/sda3 ext4 483G 410G 49G 90% /var/lib/nova/instances /dev/sda3 ext4 483G 410G 49G 90% /mnt 2、查看当前运行虚拟机情况 virsh --connect qemu:///system list --all Id Name State ---------------------------------------------------- 1 instance-000001ff running 2 instance-0000020b running 3、进入虚拟机的挂载目录 cd /var/lib/nova/instances && ll /var/lib/nova/instances drwxr-xr-x 6 nova nova 4096 Nov 27 2014 ./ drwxr-xr-x 10 nova nova 4096 Jul 7 2014 ../ drwxrwxr-x 2 nova nova 4096 Aug 14 09:38 _base/ drwxrwxr-x 2 nova nova 4096 Mar 18 2014 instance-000001ff/ drwxrwxr-x 2 nova nova 4096 Jul 7 2014 instance-0000020b/ drwxrwxr-x 2 nova nova 4096 Dec 19 2012 snapshots/ 4、查看下这2个实例用的是哪个backing file,确认完后把其他不用的删除, 1)分别进入2个实例 cd instance-000001ff && ll drwxrwxr-x 2 nova nova 4096 Mar 18 2014 ./ drwxr-xr-x 6 nova nova 4096 Nov 27 2014 ../ -rw-rw---- 1 libvirt-qemu kvm 0 May 13 08:58 console.log -rw-r--r-- 1 libvirt-qemu kvm 100087431168 Aug 14 17:40 disk -rw-r--r-- 1 libvirt-qemu kvm 197120 Mar 18 2014 disk.local -rw-rw-r-- 1 nova nova 1584 Mar 18 2014 libvirt.xml qemu-img info disk.local image: disk.local file format: qcow2 virtual size: 10G (10737418240 bytes) disk size: 200K cluster_size: 65536 backing file: /var/lib/nova/instances/_base/ephemeral_0_10_None_10 看到ephemeral_0_10_None_10这个文件 2)再进入另1个实例找到相关在使用的文件 cd instance-0000020b && ll drwxrwxr-x 2 nova nova 4096 Jul 7 2014 ./ drwxr-xr-x 6 nova nova 4096 Nov 27 2014 ../ -rw-rw---- 1 libvirt-qemu kvm 0 May 13 08:58 console.log -rw-r--r-- 1 libvirt-qemu kvm 42165207040 Aug 14 17:41 disk -rw-rw-r-- 1 nova nova 1366 Jul 7 2014 libvirt.xml qemu-img info disk image: disk file format: qcow2 virtual size: 150G (161061273600 bytes) disk size: 39G cluster_size: 65536 backing file: /var/lib/nova/instances/_base/7e24fb28e57ab77b710e562b28c888f92bdba75c_150 看到7e24fb28e57ab77b710e562b28c888f92bdba75c_150这个文件 5、最后进入/var/lib/nova/instances/_base目录, 删除上述这2个文件外的其他文件就可以释放出硬盘空间了。 6、解决之后的硬盘空间信息 df -Th Filesystem Type Size Used Avail Use% Mounted on /dev/sda1 ext4 46G 11G 34G 24% / udev devtmpfs 7.8G 4.0K 7.8G 1% /dev tmpfs tmpfs 3.2G 292K 3.2G 1% /run none tmpfs 5.0M 0 5.0M 0% /run/lock none tmpfs 7.9G 0 7.9G 0% /run/shm none tmpfs 100M 0 100M 0% /run/user cgroup tmpfs 7.9G 0 7.9G 0% /sys/fs/cgroup /dev/sda3 ext4 483G 289G 170G 64% /var/lib/nova/instances /dev/sda3 ext4 483G 289G 170G 64% /mnt
本文出自 “7928217” 博客,请务必保留此出处http://7938217.blog.51cto.com/7928217/1684787
标签:openstack libvirt qemu kvm nova
原文地址:http://7938217.blog.51cto.com/7928217/1684787