In nodem21(which is setup as undercloud)
###Login
# To get ip
virsh list
virsh domifaddr <id or name>
ssh stack@<ip>| Host noden18 | |
| HostName 10.204.216.194 | |
| User root | |
| IdentityFile ~/.ssh/id_rsa | |
| # After this need to copy id to n18 | |
| ssh-copy-id root@10.204.216.194 |
| PS1='\[$(tput bold)\]\[\033[38;5;1m\]\u\[$(tput sgr0)\]\[$(tput sgr0)\]\[\033[38;5;11m\]@\h:\[$(tput sgr0)\]\[\033[38;5;33m\][\[$(tput sgr0)\]\[\033[38;5;39m\]\w\[$(tput sgr0)\]\[\033[38;5;33m\]]\[$(tput sgr0)\]\[\033[38;5;15m\]\\$ \[$(tput sgr0)\]' |
| alias k="kubectl" | |
| alias kgp="kubectl get pods -o wide" | |
| alias kgpn="kubectl get pods -n" | |
| alias kgpa="kubectl get pods -o wide --all-namespaces" | |
| alias kgd="kubectl get deployments" | |
| alias kgs="kubectl get services" | |
| alias ke="kubectl exec -it" | |
| function keb { | |
| kubectl exec -it $1 bash || kubectl exec -it $1 sh |
| custom_host: ["curtin", "in-target", "--", "sh", "-c", "/bin/sed -i -e '/127.0.0.1 localhost/i 192.168.40.20 noden20.maas noden20' -e '/127.0.0.1 localhost/i 192.168.40.19 noden19.maas noden19' /etc/hosts"] |
| import yaml | |
| import base64 | |
| import pexpect | |
| import os | |
| import time | |
| import subprocess | |
| def change_user_password(): | |
| try: | |
| change_command = pexpect.spawn('juju change-user-password') |
| virt-install --help | less | |
| virsh dumpxml 9 | less | |
| //mnt/disk1/images/vm1.img | |
| //mnt/disk1/images/ | |
| virt-install --dry-run --name vm4 --memory 4096 --vcpus 4 --disk size=1 --location images | |
| virt-install --dry-run --name vm4 --memory 4096 --vcpus 4 --location images --disk size=1 | |
| virt-install --help | less | |
| virt-install --dry-run --name vm4 --memory 4096 --vcpus 4 --location images --disk=? | |
| virt-install --dry-run --name vm4 --memory 4096 --vcpus 4 --disk size=1 --disk pool=images | |
| virt-install --dry-run --name vm4 --memory 4096 --vcpus 4 --disk size=1 --disk pool=images --location images |
| #To fix bad hashInsert the following as after "late_commands:" in /etc/maas/preseeds/curtin_userdata | |
| prxyfix_01_cmd: ["curtin", "in-target", "--", "sh", "-c", "/bin/echo 'Acquire::http::Pipeline-Depth 0;' > /etc/apt/apt.conf.d/99FixBadProxy"] | |
| prxyfix_02_cmd: ["curtin", "in-target", "--", "sh", "-c", "/bin/echo 'Acquire::http::No-Cache true;' >> /etc/apt/apt.conf.d/99FixBadProxy"] | |
| prxyfix_03_cmd: ["curtin", "in-target", "--", "sh", "-c", "/bin/echo 'Acquire::BrokenProxy true;' >> /etc/apt/apt.conf.d/99FixBadProxy"] | |
| #Automatically insert above into /etc/maas/preseeds/curtin_userdata using sed | |
| sudo sed -e '/late_commands:/a \ \ prxyfix_01_cmd: ["curtin", "in-target", "--", "sh", "-c", "/bin/echo '"'"'Acquire::http::Pipeline-Depth 0;'"'"' > /etc/apt/apt.conf.d/99FixBadProxy"]\n\ \ prxyfix_02_cmd: ["curtin", "in-target", "--", "sh", "-c", "/bin/echo '"'"'Acquire::http::No-Cache true;'"'"' >> /etc/apt/apt.conf.d/99FixBadProxy"]\n\ \ prxyfix_03_cmd: ["curtin", "in-target", "--", "sh", "-c", "/bin/ec |
| alias s="source ~/.bashrc" | |
| alias gaa="git add --all" | |
| alias cb="code ~/.bashrc || vi ~/.bashrc" | |
| p(){ | |
| cd $(pwd) | |
| git add --all | |
| git commit -m "$1" | |
| git push origin master | |
| } |
| # If you come from bash you might have to change your $PATH. | |
| # export PATH=$HOME/bin:/usr/local/bin:$PATH | |
| # Path to your oh-my-zsh installation. | |
| export ZSH="/Users/nuthanc/.oh-my-zsh" | |
| # Set name of the theme to load --- if set to "random", it will | |
| # load a random theme each time oh-my-zsh is loaded, in which case, | |
| # to know which specific one was loaded, run: echo $RANDOM_THEME | |
| # See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes | |
| ZSH_THEME="robbyrussell" |