scripts: Add libvirt create subcommand and --os-variant

* Add `scripts/libvirt create` subcommand for rkt setups
* Add --os-variant=generic to remove nag messages to specify
* Rename places QEMU/KVM VMs were called libvirt VMs
This commit is contained in:
Dalton Hubble
2016-09-17 02:29:05 -07:00
parent dde306dec2
commit f6aec67eb8
5 changed files with 33 additions and 29 deletions

View File

@@ -1,7 +1,7 @@
# Getting Started with Docker
In this tutorial, we'll run `bootcfg` on your Linux machine with Docker to network boot and provision a cluster of CoreOS machines locally. You'll be able to create Kubernetes clustes, etcd clusters, and test network setups.
In this tutorial, we'll run `bootcfg` on your Linux machine with Docker to network boot and provision a cluster of QEMU/KVM CoreOS machines locally. You'll be able to create Kubernetes clustes, etcd clusters, and test network setups.
*Note*: To provision physical machines, see [network setup](network-setup.md) and [deployment](deployment.md).
@@ -53,7 +53,7 @@ In this case, dnsmasq runs a DHCP server allocating IPs to VMs between 172.17.0.
## Client VMs
Create VM nodes which have known hardware attributes. The nodes will be attached to the `docker0` bridge where Docker's containers run.
Create QEMU/KVM VMs which have known hardware attributes. The nodes will be attached to the `docker0` bridge, where Docker's containers run.
sudo ./scripts/libvirt create-docker
sudo virt-manager

View File

@@ -1,7 +1,7 @@
# Getting Started with rkt
In this tutorial, we'll run `bootcfg` on your Linux machine with `rkt` and `CNI` to network boot and provision a cluster of CoreOS machines locally. You'll be able to create Kubernetes clustes, etcd clusters, and test network setups.
In this tutorial, we'll run `bootcfg` on your Linux machine with `rkt` and `CNI` to network boot and provision a cluster of QEMU/KVM CoreOS machines locally. You'll be able to create Kubernetes clustes, etcd clusters, and test network setups.
*Note*: To provision physical machines, see [network setup](network-setup.md) and [deployment](deployment.md).
@@ -91,9 +91,9 @@ In this case, dnsmasq runs a DHCP server allocating IPs to VMs between 172.15.0.
## Client VMs
Create VM nodes which have known hardware attributes. The nodes will be attached to the `metal0` bridge where your pods run.
Create QEMU/KVM VMs which have known hardware attributes. The nodes will be attached to the `metal0` bridge, where your pods run.
sudo ./scripts/libvirt create-rkt
sudo ./scripts/libvirt create
sudo virt-manager
You can use `virt-manager` to watch the console and reboot VM machines with

View File

@@ -21,7 +21,7 @@ Guides and a service for network booting and provisioning CoreOS clusters on vir
* Config Templates
* [Ignition](Documentation/ignition.md)
* [Cloud-Config](Documentation/cloud-config.md)
* Tutorials (qemu/kvm/libvirt)
* Tutorials (QEMU/KVM/libvirt)
* [bootcfg with rkt](Documentation/getting-started-rkt.md)
* [bootcfg with Docker](Documentation/getting-started-docker.md)
* [Configuration](Documentation/config.md)
@@ -44,7 +44,7 @@ Guides and a service for network booting and provisioning CoreOS clusters on vir
### Examples
The [examples](examples) network boot and provision CoreOS clusters. Network boot [libvirt](scripts/README.md#libvirt) VMs to try the examples on your Linux laptop.
The [examples](examples) network boot and provision CoreOS clusters. Network boot [QEMU/KVM](scripts/README.md#libvirt) VMs to try the examples on your Linux laptop.
* Multi-node [Kubernetes cluster](Documentation/kubernetes.md)
* Multi-node Kubernetes cluster with rkt container runtime (i.e. rktnetes)

View File

@@ -23,19 +23,20 @@ This will create:
## libvirt
Create libvirt VM nodes which are configured to boot from the network. The `scripts/libvirt` script will create virtual machines on the `metal0` or `docker0` bridge with known hardware attributes (e.g. UUID, MAC address).
Create QEMU/KVM VMs which are configured to boot from the network. The `scripts/libvirt` script will create virtual machines on the `metal0` or `docker0` bridge with known hardware attributes (e.g. UUID, MAC address).
$ sudo ./scripts/libvirt
USAGE: libvirt <command>
Commands:
create-docker create libvirt nodes on the docker0 bridge
create-rkt create libvirt nodes on a rkt CNI metal0 bridge
create-uefi create UEFI libvirt nodes on the rkt CNI metal0 bridge
start start the libvirt nodes
reboot reboot the libvirt nodes
shutdown shutdown the libvirt nodes
poweroff poweroff the libvirt nodes
destroy destroy the libvirt nodes
create create QEMU/KVM nodes on a rkt CNI metal0 bridge
create-rkt create QEMU/KVM nodes on a rkt CNI metal0 bridge
create-docker create QEMU/KVM nodes on the docker0 bridge
create-uefi create UEFI QEMU/KVM nodes on the rkt CNI metal0 bridge
start start the QEMU/KVM nodes
reboot reboot the QEMU/KVM nodes
shutdown shutdown the QEMU/KVM nodes
poweroff poweroff the QEMU/KVM nodes
destroy destroy the QEMU/KVM nodes
## k8s-certgen

View File

@@ -1,17 +1,18 @@
#!/bin/bash
# Manage VM nodes which have a specific set of hardware attributes.
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source "${DIR}/common.sh"
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source "${DIR}/common.sh"
function main {
case "$1" in
"create") create_rkt;;
"create-docker") create_docker;;
"create-rkt") create_rkt;;
"create-uefi") create_uefi;;
@@ -30,16 +31,18 @@ function main {
function usage {
echo "USAGE: ${0##*/} <command>"
echo "Commands:"
echo -e "\tcreate-docker\tcreate libvirt nodes on the docker0 bridge"
echo -e "\tcreate-rkt\tcreate libvirt nodes on a rkt CNI metal0 bridge"
echo -e "\tcreate-uefi\tcreate UEFI libvirt nodes on the rkt CNI metal0 bridge"
echo -e "\tstart\t\tstart the libvirt nodes"
echo -e "\treboot\t\treboot the libvirt nodes"
echo -e "\tshutdown\tshutdown the libvirt nodes"
echo -e "\tpoweroff\tpoweroff the libvirt nodes"
echo -e "\tdestroy\t\tdestroy the libvirt nodes"
echo -e "\tcreate\t\tcreate QEMU/KVM nodes on a rkt CNI metal0 bridge"
echo -e "\tcreate-rkt\tcreate QEMU/KVM nodes on a rkt CNI metal0 bridge"
echo -e "\tcreate-docker\tcreate QEMU/KVM nodes on the docker0 bridge"
echo -e "\tcreate-uefi\tcreate UEFI QEMU/KVM nodes on the rkt CNI metal0 bridge"
echo -e "\tstart\t\tstart the QEMU/KVM nodes"
echo -e "\treboot\t\treboot the QEMU/KVM nodes"
echo -e "\tshutdown\tshutdown the QEMU/KVM nodes"
echo -e "\tpoweroff\tpoweroff the QEMU/KVM nodes"
echo -e "\tdestroy\t\tdestroy the QEMU/KVM nodes"
}
COMMON_VIRT_OPTS="--memory=1024 --vcpus=1 --os-type=linux --noautoconsole --pxe --disk pool=default,size=6 "
COMMON_VIRT_OPTS="--memory=1024 --vcpus=1 --pxe --disk pool=default,size=6 --os-type=linux --os-variant=generic --noautoconsole"
function create_docker {
virt-install --name $NODE1_NAME --network=bridge:docker0,mac=$NODE1_MAC $COMMON_VIRT_OPTS --boot=hd,network