Perry Myers
2008-Jun-28 22:19 UTC
[Ovirt-devel] [PATCH] Two convenience scripts to simplify appliance usage
ovirt-firefox.sh is used to launch firefox on the appliance ovirt-view-vm.sh is used to launch virt-viewer on a specific managed node connected to a specific virtual machine. These script should simplify some of the instructions we have on the website. Signed-off-by: Perry Myers <pmyers at redhat.com> --- wui-appliance/ovirt-firefox.sh | 8 ++++++++ wui-appliance/ovirt-view-vm.sh | 17 +++++++++++++++++ 2 files changed, 25 insertions(+), 0 deletions(-) create mode 100755 wui-appliance/ovirt-firefox.sh create mode 100755 wui-appliance/ovirt-view-vm.sh diff --git a/wui-appliance/ovirt-firefox.sh b/wui-appliance/ovirt-firefox.sh new file mode 100755 index 0000000..94d7f82 --- /dev/null +++ b/wui-appliance/ovirt-firefox.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +KNOWN_HOSTS=~/.ssh/ovirt-known_hosts +SSH_ARGS="-o StrictHostKeyChecking=no -o UserKnownHostsFile=$KNOWN_HOSTS -Yf" + +rm -f $KNOWN_HOSTS > /dev/null 2>&1 +ssh $SSH_ARGS 192.168.50.2 firefox --no-remote + diff --git a/wui-appliance/ovirt-view-vm.sh b/wui-appliance/ovirt-view-vm.sh new file mode 100755 index 0000000..1e5ebaa --- /dev/null +++ b/wui-appliance/ovirt-view-vm.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +KNOWN_HOSTS=~/.ssh/ovirt-known_hosts +SSH_ARGS="-o StrictHostKeyChecking=no -o UserKnownHostsFile=$KNOWN_HOSTS -Yf" + +if [[ $# < 2 ]]; then + echo "usage: $0 node vm" + echo " node: hostname of node to connect to (i.e. node3)" + echo " vm : name of virtual machine on designated node to view" + exit 1 +fi + +NODE=$1 +VM=$2 + +rm -f $KNOWN_HOSTS > /dev/null 2>&1 +ssh $SSH_ARGS 192.168.50.2 virt-viewer -c qemu+tcp://$NODE.priv.ovirt.org/system $VM -- 1.5.5.1
Chris Lalancette
2008-Jun-30 07:03 UTC
[Ovirt-devel] [PATCH] Two convenience scripts to simplify appliance usage
Perry Myers wrote:> ovirt-firefox.sh is used to launch firefox on the appliance > ovirt-view-vm.sh is used to launch virt-viewer on a specific managed node > connected to a specific virtual machine.Sure, should make life a little easier.> +KNOWN_HOSTS=~/.ssh/ovirt-known_hosts > +SSH_ARGS="-o StrictHostKeyChecking=no -o UserKnownHostsFile=$KNOWN_HOSTS -Yf" > + > +rm -f $KNOWN_HOSTS > /dev/null 2>&1 > +ssh $SSH_ARGS 192.168.50.2 firefox --no-remoteSneaky. Redefine where the known hosts goes, and blow it away. Do we need both "StrictHostKeyChecking=no" and the removal of KnownHosts, though? <snip>> +if [[ $# < 2 ]]; then > + echo "usage: $0 node vm" > + echo " node: hostname of node to connect to (i.e. node3)" > + echo " vm : name of virtual machine on designated node to view" > + exit 1 > +fiMinor whitespace damage.> + > +NODE=$1 > +VM=$2 > + > +rm -f $KNOWN_HOSTS > /dev/null 2>&1 > +ssh $SSH_ARGS 192.168.50.2 virt-viewer -c qemu+tcp://$NODE.priv.ovirt.org/system $VMOther than the two minor issues above, looks good, so I will ACK it. Chris Lalancette
Perry N. Myers
2008-Jul-01 00:33 UTC
[Ovirt-devel] [PATCH] Two convenience scripts to simplify appliance usage
Chris Lalancette wrote:> Perry Myers wrote: >> ovirt-firefox.sh is used to launch firefox on the appliance >> ovirt-view-vm.sh is used to launch virt-viewer on a specific managed node >> connected to a specific virtual machine. > > Sure, should make life a little easier. > >> +KNOWN_HOSTS=~/.ssh/ovirt-known_hosts >> +SSH_ARGS="-o StrictHostKeyChecking=no -o UserKnownHostsFile=$KNOWN_HOSTS -Yf" >> + >> +rm -f $KNOWN_HOSTS > /dev/null 2>&1 >> +ssh $SSH_ARGS 192.168.50.2 firefox --no-remote > > Sneaky. Redefine where the known hosts goes, and blow it away. Do we need both > "StrictHostKeyChecking=no" and the removal of KnownHosts, though?Yes. Even with StrickHostKeyChecking=no, if you don't blow away known hosts you'll get a nasty warning message. And if you just do the known-hosts delete, you'll get a prompt to add the new key on each connect. So the combination does the trick. Of course, this is a controlled test environment. Don't do this at home, kids...> <snip> > >> +if [[ $# < 2 ]]; then >> + echo "usage: $0 node vm" >> + echo " node: hostname of node to connect to (i.e. node3)" >> + echo " vm : name of virtual machine on designated node to view" >> + exit 1 >> +fi > > Minor whitespace damage.Already fixed :)>> + >> +NODE=$1 >> +VM=$2 >> + >> +rm -f $KNOWN_HOSTS > /dev/null 2>&1 >> +ssh $SSH_ARGS 192.168.50.2 virt-viewer -c qemu+tcp://$NODE.priv.ovirt.org/system $VM > > Other than the two minor issues above, looks good, so I will ACK it.Thanks, Perry