openstack instance err:”Exeeded maximum number of retries”

0, the error instance log show:

image.png

1, check the /var/log/nova/nova-compute.log, the log show:

image.png

maybe the device cannot support the kvm or not have the modue

reference from : 

"https://ask.openstack.org/en/question/99882/libvirterror-invalid-argument-could-not-find-capabilities-for-domaintypekvm/"

"https://github.com/minishift/minishift/issues/1630"

2, install the qemu-kvm

image.png

3, restart the nova-compute container 

and relaunch a new instance, it still show the same err:"Exeeded maximum number of retries", but the nova-compute.log show difference, there is no permission access kvm character device

image.png

reference from: "https://serverfault.com/questions/1002043/libvirt-has-no-kvm-capabilities-even-though-qemu-kvm-works"

4, and the change the permission to 666 /dev/kvm

image.png

5, relaunch the instance and it works

sed in MacOS

1, use G command to add a new line

https://stackoverflow.com/questions/6111679/insert-linefeed-in-sed-mac-os-x/6112034

2, use parameter in substitution command

https://stackoverflow.com/questions/34969408/path-substitution-with-sed-and-shell-variables-on-os-x

dig +short baidu.com

sudo cp /etc/pf.conf /etc/pf.conf_bak`date +%Y%m%d%H%M%S`

output_cmd="pass out proto tcp from any to ${1} port ${2}"

sudo sed -i '' -e '${G;}' /etc/pf.conf

sudo sed -i '' -e "$ s/$/$output_cmd/" /etc/pf.conf

sudo pfctl -evf /etc/pf.conf