{ "info": { "author": "Scott Choi", "author_email": "hho.choi@me.com", "bugtrack_url": null, "classifiers": [], "description": "mykvm\n=====\n\n* mykvm is a small python script to create multiple kvm instances from the yaml configuration file. \n* mykvm is using some nice tools like virt-install, vmbuilder, qemu-img and ansible.\n\nInstallation\n------------\n\n* Install kvm, virt-install, vmbuilder and some packages for ansible. Ansible will be used to initialize kvm instances.\n\n $ sudo apt-get update\n $ sudo apt-get install kvm libvirt-bin virtinst\tpython-vm-builder python-dev python-pip\n\n* If you don't have any ssh key, generate a new ssh key. This key will be used to ssh into the kvm instances. \n\n $ ssh-keygen -t rsa\n\n* Install mykvm with pip\n\n $ sudo pip install mykvm\n\n* Now, mykvm is ready\n\n\t\t$ mykvm \n\t\tUsage: mykvm command []\n\n\t\tAvailable subcommands:\n\t\t init\n\t\t up []\n\t\t halt\n\t\t destroy\n\t\t status\n\nUsage\n---------------\n\n* Create a new directory\n\n\t\t$ mkdir grizzly\n\t\t$ cd grizzly\n\n* Run init command. If there's no base image, vmbuilder will create a precise64.qcow2 base image.\n\n\t\t$ mykvm init\n\t\tinitialize mykvm\n\t\t\n\t\t* create mykvm.yml\n\t\t* copy vmbuilder script\n\t\t* copy ansible files\n\t\t* build base image /home/cirros/.mykvm/base/precise64.qcow2\n\t\t+ rm -rf ubuntu-kvm\n\t\t+ SUDOERS_TMPL=/etc/vmbuilder/ubuntu/sudoers.tmpl\n\t\t+ grep -q -e ubuntu /etc/vmbuilder/ubuntu/sudoers.tmpl\n\t\t+ sudo sed -i '$a ubuntu ALL=(ALL) NOPASSWD:ALL\\n#includedir /etc/sudoers.d' /etc/vmbuilder/ubuntu/sudoers.tmpl\n\t\t+ sudo vmbuilder kvm ubuntu --suite precise --arch amd64 --flavour virtual --ssh-user-key /home/cirros/.ssh/id_rsa.pub ...\n\t\t...\n\t\t\n* Up command will start networks and kvm instances with configurations in mykvm.yml.\n\n\t\t$ mykvm up\n\t\t\n* Check the status of kvm instances.\n\n\t\t$ mykvm status\n\t\tstatus\n\t\t\n\t\t Id Name State\n\t\t----------------------------------\n\t\t 1 controller running\n\t\t 2 netnode running\n\t\t 3 compute1 running\n\t\t 4 compute2 running\n\t\t \n* You can use virsh to control kvm instances.\n\n\t\t$ sudo virsh list\n\t\t Id Name State\n\t\t----------------------------------\n\t\t 1 controller running\n\t\t 2 netnode running\n\t\t 3 compute1 running\n\t\t 4 compute2 running\n\t\t \n* You can ssh into the kvm instances with hostname. /etc/resolv.conf is updated to use the dnsmasq of first network in mykvm.yml as a nameserver.\n\n\t\t$ ssh ubuntu@controller\n\n* Destroy command will stop networks and destroy kvm instances.\n\n\t\t$ mykvm destroy \n\nConfiguration\n---------------\n\n* mykvm.yml configuration file look like this. \n* You can define multiple networks and vm instances with multiple network interfaces. \n* You can create nested kvm instances with 'kvm_nested' option.\n\n\t\t$ cat mykvm.yml \n\t\t---\n\t\t- networks:\n\t\t - name: mgmt\n\t\t external: true\n\t\t autostart: true\n\t\t ip: 10.0.10.1\n\t\t\n\t\t - name: int\n\t\t ip: 10.0.20.1\n\t\t\n\t\t - name: ext\n\t\t external: true\n\t\t ip: 192.168.101.1\n\t\t\n\t\t- vms:\n\t\t - name: controller \n\t\t vcpus: 1\n\t\t ram: 2048 \n\t\t template: precise64.qcow2\n\t\t netdevs:\n\t\t - network: mgmt\n\t\t ip: 10.0.10.10\n\t\t - network: ext\n\t\t ip: 192.168.101.10\n\t\t\n\t\t - name: netnode \n\t\t vcpus: 2\n\t\t ram: 1024 \n\t\t template: precise64.qcow2\n\t\t netdevs:\n\t\t - network: mgmt\n\t\t ip: 10.0.10.11\n\t\t - network: int\n\t\t ip: 10.0.20.11\n\t\t - network: ext\n\t\t ip: 192.168.101.11 \n\t\t \n\t\t - name: compute1 \n\t\t vcpus: 2\n\t\t kvm_nested: True\n\t\t ram: 2048 \n\t\t template: precise64.qcow2\n\t\t netdevs:\n\t\t - network: mgmt\n\t\t ip: 10.0.10.12\n\t\t - network: int\n\t\t ip: 10.0.20.12\n\n* Nested KVM Hypervisor Support\n\n\t\t$ echo \"options kvm-intel nested=1\" | sudo tee /etc/modprobe.d/kvm-intel.conf\n\t\t$ sudo reboot\n\t\t$ cat /sys/module/kvm_intel/parameters/nested \n\t\tY\n\nIssues\n====================\n\n* Only tested on Ubuntu 12.04 boxes with intel cpu.\n* Sometimes the base image generated by vmbuilder is not bootable. In that case, delete ubuntu-kvm directory and the base image under ~/.mykvm/base and run again init command to recreate a base image. \n", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/scottchoi/mykvm", "keywords": "kvm vmbuilder qemu-imge virt-install", "license": "PSF", "maintainer": null, "maintainer_email": null, "name": "mykvm", "package_url": "https://pypi.org/project/mykvm/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/mykvm/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/scottchoi/mykvm" }, "release_url": "https://pypi.org/project/mykvm/0.3.8/", "requires_dist": null, "requires_python": null, "summary": "mykvm is a vagrant like tool to create multiple kvm instances", "version": "0.3.8" }, "last_serial": 873317, "releases": { "0.3.3": [ { "comment_text": "", "digests": { "md5": "e88f63540c7bb5822270ba52d0013ee6", "sha256": "78f066ed9547fef7519e948a23077d746e46abccfb2e4fea4c4e0b2bbc7013b1" }, "downloads": -1, "filename": "mykvm-0.3.3.tar.gz", "has_sig": false, "md5_digest": "e88f63540c7bb5822270ba52d0013ee6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7011, "upload_time": "2013-08-09T15:28:42", "url": "https://files.pythonhosted.org/packages/38/63/c1c2cdc556e03a229e88e485b7e754ef5b0f5eacf88a980b1e378377a35c/mykvm-0.3.3.tar.gz" } ], "0.3.5": [ { "comment_text": "", "digests": { "md5": "8618df1fd98d57209202622a621526b8", "sha256": "f8a108296dff9364b13ca782a0843ec07ac5c08e6dce00c9fa7a5402c1f4ea6d" }, "downloads": -1, "filename": "mykvm-0.3.5.tar.gz", "has_sig": false, "md5_digest": "8618df1fd98d57209202622a621526b8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8065, "upload_time": "2013-08-21T13:49:26", "url": "https://files.pythonhosted.org/packages/0e/46/d048fc1ca4bfeb98af953239784697d48c8e2a7a952f915072f56b9d859d/mykvm-0.3.5.tar.gz" } ], "0.3.6": [ { "comment_text": "", "digests": { "md5": "b90856dbfd21ff1758bbbea10b62143b", "sha256": "28a2e402152434416e78b9fb2ea5506b7e88cd0877cd8321e358f7ee0294f374" }, "downloads": -1, "filename": "mykvm-0.3.6.tar.gz", "has_sig": false, "md5_digest": "b90856dbfd21ff1758bbbea10b62143b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8105, "upload_time": "2013-08-21T14:02:04", "url": "https://files.pythonhosted.org/packages/09/5d/dfd9fee3989bc0bd57badbd94fd6f216ea0a1411d487e0dfabb9c911a1d8/mykvm-0.3.6.tar.gz" } ], "0.3.7": [ { "comment_text": "", "digests": { "md5": "87fd0f16940be3e6ea5316c5cf0859df", "sha256": "73d92f5793910dabce1e0eaed0befc430b05b98883106cbfb5efd4e870b847ab" }, "downloads": -1, "filename": "mykvm-0.3.7.tar.gz", "has_sig": false, "md5_digest": "87fd0f16940be3e6ea5316c5cf0859df", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8134, "upload_time": "2013-08-26T12:01:30", "url": "https://files.pythonhosted.org/packages/fd/a2/983255c5680855818513abc7cbb06c76a371fd3b26eb8c4fc813b8f294e0/mykvm-0.3.7.tar.gz" } ], "0.3.8": [ { "comment_text": "", "digests": { "md5": "39a0cbc429e32546b327e6bf101e7be7", "sha256": "f33cfafdd3e47969cc4beb07e9189982682371cb0248176ca673caebd1995272" }, "downloads": -1, "filename": "mykvm-0.3.8.tar.gz", "has_sig": false, "md5_digest": "39a0cbc429e32546b327e6bf101e7be7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8249, "upload_time": "2013-09-25T01:56:03", "url": "https://files.pythonhosted.org/packages/ae/78/f90e0473de583d8c080c758dfa105e7bde1c6936d891768fd504e924fba0/mykvm-0.3.8.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "39a0cbc429e32546b327e6bf101e7be7", "sha256": "f33cfafdd3e47969cc4beb07e9189982682371cb0248176ca673caebd1995272" }, "downloads": -1, "filename": "mykvm-0.3.8.tar.gz", "has_sig": false, "md5_digest": "39a0cbc429e32546b327e6bf101e7be7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8249, "upload_time": "2013-09-25T01:56:03", "url": "https://files.pythonhosted.org/packages/ae/78/f90e0473de583d8c080c758dfa105e7bde1c6936d891768fd504e924fba0/mykvm-0.3.8.tar.gz" } ] }