[GitHub] cloudstack pull request: Convert patchviasocket to python (removes...
Github user sverrirab commented on the pull request: https://github.com/apache/cloudstack/pull/1533#issuecomment-219751032 @wido I just pushed an update that addresses the comments from @jburwell tested this locally as well of course --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: Convert patchviasocket to python (removes...
Github user sverrirab commented on the pull request: https://github.com/apache/cloudstack/pull/1533#issuecomment-220644228 Rebased the PR to latest master and reverted the relevant commit (64b72a5c5a410f41bd869cc9d40807d888e05055.). I think we should be good to go @swill ? --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: Convert patchviasocket to python (removes...
Github user sverrirab commented on the pull request: https://github.com/apache/cloudstack/pull/1533#issuecomment-221026255 everything looking good now it seems - time to merge @swill ? --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: Add perl-modules as install dependency fo...
Github user sverrirab closed the pull request at: https://github.com/apache/cloudstack/pull/1526 --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack issue #1633: [blocker] CLOUDSTACK-9452: use optparse instead of a...
Github user sverrirab commented on the issue: https://github.com/apache/cloudstack/pull/1633 The updated script that now depends on python 2.7 (or python 2.6 + argparse I assume) is replacing the perl installation requirement that was there before. Would it not be the correct solution to require python 2.7 to be installed? If the hosts are dedicated KVM hosts that should be relatively low risk? --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack issue #1633: [blocker] CLOUDSTACK-9452: use optparse instead of a...
Github user sverrirab commented on the issue: https://github.com/apache/cloudstack/pull/1633 The reason for my suggestion is that I don't think anyone should be running python 2.6 in production. The last update for it was in 2008 so I would consider it risky at this point. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack issue #1633: [blocker] CLOUDSTACK-9452: use optparse instead of a...
Github user sverrirab commented on the issue: https://github.com/apache/cloudstack/pull/1633 adding the python-argparse dependency is fine by me. I have not tested that combination though. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack issue #1634: [blocker] CLOUDSTACK-9452: add python-argparse depen...
Github user sverrirab commented on the issue: https://github.com/apache/cloudstack/pull/1634 +1 from me (for what it's worth) --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: Installing bzip2 since it is required for...
GitHub user sverrirab opened a pull request: https://github.com/apache/cloudstack/pull/1490 Installing bzip2 since it is required for extracting templates If you do not install bzip2, then installing templates that are bzip2 compressed will result in Cloudstack not being able to extract the contents and ending up copying the template in compressed form. This will result in VMs not being able to start. You can merge this pull request into a Git repository by running: $ git pull https://github.com/greenqloud/cloudstack pr-bzip2-install Alternatively you can review and apply these changes as the patch at: https://github.com/apache/cloudstack/pull/1490.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #1490 commit 86600ed0f777d52b8e43a960d2c5e6e5dd38f4e8 Author: Sverrir Berg Date: 2016-04-13T10:35:27Z Installing bzip2 since it is required for extracting templates --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: Add perl-modules as install dependency fo...
GitHub user sverrirab opened a pull request: https://github.com/apache/cloudstack/pull/1495 Add perl-modules as install dependency for cloudstack-agent Required to run perl scripts that configure networking for VMs. You can merge this pull request into a Git repository by running: $ git pull https://github.com/greenqloud/cloudstack pr-install-perl-modules-on-agent Alternatively you can review and apply these changes as the patch at: https://github.com/apache/cloudstack/pull/1495.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #1495 commit 6d6bd510c2f5dc3fe076183379388521a55f95fe Author: Sverrir Berg Date: 2016-04-13T16:48:31Z Add perl-modules as install dependency for cloudstack-agent Required to run perl scripts that configure networking for VMs. That script fails silently if this is not installed. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: Add perl-modules as install dependency fo...
Github user sverrirab commented on the pull request: https://github.com/apache/cloudstack/pull/1495#issuecomment-210485675 I agree that this is not a good approach but it is the current one and it is broken. How about we commit this fix and I submit a new PR to master with a new python script? --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: Add perl-modules as install dependency fo...
Github user sverrirab commented on the pull request: https://github.com/apache/cloudstack/pull/1495#issuecomment-214783340 do you want this change as a new PR against master or just the rewritten script in python on master? --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: Add perl-modules as install dependency fo...
GitHub user sverrirab opened a pull request: https://github.com/apache/cloudstack/pull/1526 Add perl-modules as install dependency for cloudstack-agent Required to run perl scripts that configure networking for VMs. That script fails silently if this is not installed. As requested here: https://github.com/apache/cloudstack/pull/1495 Another PR will be submitted with the module written in python to remove this dependency... You can merge this pull request into a Git repository by running: $ git pull https://github.com/greenqloud/cloudstack pr-master-agent-perl-modules-install Alternatively you can review and apply these changes as the patch at: https://github.com/apache/cloudstack/pull/1526.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #1526 commit c70802fde9f170046118f977bd7ee856205e2064 Author: Sverrir Berg Date: 2016-04-13T16:48:31Z Add perl-modules as install dependency for cloudstack-agent Required to run perl scripts that configure networking for VMs. That script fails silently if this is not installed. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: Add perl-modules as install dependency fo...
Github user sverrirab commented on the pull request: https://github.com/apache/cloudstack/pull/1495#issuecomment-216233064 Created new PR on master: https://github.com/apache/cloudstack/pull/1526 --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: Convert patchviasocket to python (removes...
GitHub user sverrirab opened a pull request: https://github.com/apache/cloudstack/pull/1533 Convert patchviasocket to python (removes perl dependency for KVM agent) As requested here: https://github.com/apache/cloudstack/pull/1495 No scripts are using perl so that install requirement can be removed. The new scripts are using standard python packages only. Includes extensive unit test. Note: perl-modules requirement is missing (fixed in mentioned PR) so do not merge that onto master. You can merge this pull request into a Git repository by running: $ git pull https://github.com/greenqloud/cloudstack pr-patchviasocket-convert-to-python Alternatively you can review and apply these changes as the patch at: https://github.com/apache/cloudstack/pull/1533.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #1533 commit 3d8f74f9bc5e6cc3c6170c2320628ce2a2ce532a Author: Sverrir A. Berg Date: 2016-05-03T15:17:59Z Convert patchviasocket to python (removes perl dependency for KVM agent) As requested here: https://github.com/apache/cloudstack/pull/1495 No scripts are using perl so that install requirement can be removed. The new scripts are using standard python packages only. Includes extensive unit test. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] cloudstack pull request: Convert patchviasocket to python (removes...
Github user sverrirab commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/1533#discussion_r62309904 --- Diff: scripts/vm/hypervisor/kvm/patchviasocket.py --- @@ -0,0 +1,80 @@ +#!/usr/bin/env python +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# +# This script connects to the system vm socket and writes the +# authorized_keys and cmdline data to it. The system VM then +# reads it from /dev/vport0p1 in cloud_early_config +# + +import argparse +import os +import socket + +SOCK_FILE = "/var/lib/libvirt/qemu/{name}.agent" +PUB_KEY_FILE = "/root/.ssh/id_rsa.pub.cloud" +MESSAGE = "pubkey:{key}\ncmdline:{cmdline}\n" + + +def read_pub_key(key_file): +try: +if os.path.isfile(key_file): +with open(key_file, "r") as f: +return f.read() +except IOError: +return None + + +def send_to_socket(sock_file, key_file, cmdline): +pub_key = read_pub_key(key_file) + +if not pub_key: +print("ERROR: ssh public key not found on host at {0}".format(key_file)) +return 1 + +# Keep old substitution from perl code: +cmdline = cmdline.replace("%", " ") + +msg = MESSAGE.format(key=pub_key, cmdline=cmdline) + +if not os.path.exists(sock_file): +print("ERROR: {0} socket not found".format(sock_file)) +return 1 + +try: +s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) +s.connect(sock_file) +s.sendall(msg) +s.close() +except IOError as e: --- End diff -- IOError is the parent of socket.error so this will catch all socket related errors. The code as it stands returns 1 on any error and 0 on success - so there is no benefit of adding a finally statement there that I can see. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---