Commits
Author | Commit | Message | Commit date | Issues | |
---|---|---|---|---|---|
Dmitry Guryanov | 72fc7ec2d51 | add more info to README file | |||
Dmitry Guryanov | 100b59e89cc | add COPYING file | |||
Dmitry Guryanov | cb579040e69 | add README file | |||
Dmitry Guryanov | decb447b4fa | add license information | |||
Dmitry Guryanov | 71d4cd62db3 | don't use DHCP for network configuration by defaultSetting static IP configuration on interfaces is more reliable, than using DHCP. At least now DHCP doesn't work, if you set external gateway on router (because we don't have full namespaces support and DHCP replies are being SNAT'ed). | |||
Dmitry Guryanov | 94d275d3ee4 | assume we always use neutron's firewallLet's forbid nova's firewall, since it doesn't work anyway (because we need to change devname in network_info into appropriate value vethXXX.X or vmeXXXX). Also let's always connect instances to integration bridge via intermediate linux bridge. Let's keep VifOvsEthernet class and all methods, which tune nova firewall. Maybe someone will need it later. | |||
Dmitry Guryanov | 7a57c7eddf4 | add firewall class for neutronHere is how neutron with OVS works: br-int <pcsvoXXX>|--|<pcsvbXXX> pcsbrXXX <veth100.0>|---<eth0 in CT> First, we have integration bridge br-int and veth pair, one end of which is inside container, another one (veth100.0) - in host. We have to connect veth100.0 to bridge br-int. Also neutron need to setup security group rules between container and br-int. IptablesFirewallDriver class does it... | |||
Dmitry Guryanov | b6db6d5d1b7 | don't rename PCS's network devicesInstead of renaming PCS devices 'vethXXX.X' and 'vmeXXX' we can provide name to netutron's firewall driver with help of OVS's external_ids. So first, don't rename devices and second, add iface-name external id to OVS port (linux_net.create_ovs_vif_port can't do it, so add function pcs_create_ovs_vif_port). | |||
Dmitry Guryanov | d4d1f562147 | implement networking with help of prlsdkapiWe can't use vzctl for VMs, so it's needed to manage network in VEs using prlsdkapi. It's not possible to get device in host with given name using only prlsdkapi, so I use 2 hacks: 1. If you specify unexistent virtual network id, device will not be connected to any bridges, and VE will be started correctly. 2. Interface can be renamed if it's down. So all works exactly as before: we creat... | |||
Dmitry Guryanov | 64e7fa205f2 | add format_mac functionMAC addresses can have different string formats. So we can't compare them as is. format_mac will convert MAC address to format XX:XX:XX:XX:XX:XX, so macs returned by this function could be compared. | |||
Dmitry Guryanov | e5ce38408bf | import prlsdkapi in vif.pySubsequent patches will use prlconsts, so import prlsdkapi and consts module. Exactly as in driver.py. | |||
Dmitry Guryanov | f612dbd0631 | pass prlsdkapi.Vm object to vif driverCreating Vm object by given uuid or name of the VE is relatively slow operation and should be avoided if possible. So let's pass Vm object to plug and unplug methods of vif driver. Consequent patches will need it. | |||
Dmitry Guryanov | 06c510bb4e9 | call unplug_vifs before VE destroyunplug_vifs checks, if VE exists, so if we destroy it before, unplug_vifs will not be called. | |||
Dmitry Guryanov | 162a057e9c8 | fix integer options in pcs-glance-tool--min-disk and --min-ram options has type int, so corresponding 'type' kerword argument should be given to @arg decorator. | |||
Dmitry Guryanov | 3052022b9c4 | fix snapshot method for VMsadd VM support to snapshot method. We have to set disk_format to ploop-vm in this case. Snapshot for VMs can be created only if VM is powered off, because of limitation in prlsdkapi. | |||
Dmitry Guryanov | 8075363ba31 | use disk_format to distinguish containers and VMsUse disk_format to distinguish containers and VMs instead of container_format. When we will add support of booting from volumes it will be easier to check, which virtualization type is supported by specific volume. ez templates support will be removed soon, so let's also use another disk_format for them. | |||
Dmitry Guryanov | bb2bd54a1e7 | fix pcs-glance-tool for VMsget_home_path works differently for VMs and containers, for containers it returns path to private area, but for VMs - path to cofnig file config.pvs. | |||
Dmitry Guryanov | a3bb84ea4f3 | add basic support of VMsAdd support of running VMs as openstack instances. You have to create image in glance with container format pcs-vm and then launch it, proper type of virtualization will be automatically selected. Netwokirng is not supported yet, because vzctl is used to configure network in container and that place have to be fixed before enabling networking in VMs. | |||
Dmitry Guryanov | 84de6643c20 | change disk size correctlyChanging disk size is not a change in a config file, so it should be outsize of begin_edit/commit. Also this is an asynchronous operation and return job object, which have to be wait'ed. | |||
Dmitry Guryanov | f32376d89ff | add tool for creating glance images from PCS VEsAdd script pcs-glance-tool which creates glance images by given container or VM name. It's a sort of an extension to glance command, so it supports all common arguments, which are supported by glance and environment variables (like --os-auth-url, --os-tenant-id or OS_USERNAME env var). Example of usage: ./pcs-image-util.py --os-image-api-version 2 \ image-create my-container --name ne... | |||
Dmitry Guryanov | 11b26a0ba74 | rename install-image.py to add-ez-image.pyI'll add another script for creating image from existing container or VM, which also will do 'install-image', so let's rename this one. | |||
Dmitry Guryanov | 20a05efdaf0 | rename image container_format to pcs-containerI'm going to add support for VMs and they should have another container format since it's should be possible if we have to create container or VM from given image. Templates of both containers and VMs called 'golden image' in our terminology, so let's use container formats 'pcs-container' and 'pcs-vm'. | |||
Dmitry Guryanov | 17bab21642a | rename pcs_golden_image_dir to pcs_template_dirRename configuration parameter pcs_golden_image_dir to pcs_template_dir. | |||
Dmitry Guryanov | 28c5e72472a | rename PCSDriver._psrv to psrvThere is no need to have name of this variable starting with underscope, because all parts of the driver need to work with SDK and have to use prlsdkapi.Server object. | |||
Dmitry Guryanov | 38c430c0be7 | pass link to virt driver to vif driverFurther patches will use parallels SDK, so prlsdkapi.Server is needed at least in vif driver classes. | |||
Dmitry Guryanov | a226ba273be | implement methods for firewall managementAdd a set of methods, which do different operations with firewall. In case of PCS driver they only call the same methods from nova's firewall driver. | |||
Dmitry Guryanov | eb3477471e8 | remove firewall rules after destroying instanceFirewall rules must be removed when we destroy an instance. | |||
Dmitry Guryanov | ea6fd9c367f | fix bug with setting up VNCget_vnc_port method of Vm class doesn't requests new VNC port from server, it just returns a value, which was retrieved with get_vm_config SDK call (0, if VNC was disabled). So after setting up VNC we have to request new VM config from server. | |||
Dmitry Guryanov | a4c0d0be42b | remove unneded function get_name from EzTemplate classDirect access to the name attribute is better inside class. | |||
Dmitry Guryanov | a4e96f9059b | add helper function for sdk error codes conversionParallels SDK provides error codes in exceptions different from constants defined. Special function conv_error must be used to convert condtant to error code in python. So let's add helper function get_sdk_errcode. | |||
Dmitry Guryanov | 70f50ebd789 | add support of spawning instances from snapshotsAdd ability to create an instance based on snapshot. GoldenImageTemplate is added for this purpose. get_template will return proper PCSTemplate object depending on container_type property of an image. | |||
Dmitry Guryanov | b339e139375 | remove network adapters from VE before saving imageWe don't need to store information about network adapters in snapshot. Moreover disk data is the only thing we need to store in snapshot, but it's not possible with parallels SDK to create container from existing disk. We will add new network adapters each time in spawn method. So snapshot method is a good place to clean network configuration. | |||
Dmitry Guryanov | 05192a17e8e | don't use image_ref and context attributes in EzTemplateimage_ref and context attributes was removed by previous patch, so don't use them anymore. | |||
Dmitry Guryanov | 7f691ece73d | don't store unneded attributes in EzTemplate classcontext and image_ref are used only in __init__ in EzTemplate class. So no need to store them as attributes. | |||
Dmitry Guryanov | d39fdbaba65 | use special container types in glanceNow we have to different types of images in glance: ez templates and tarred containers. So we need to distinguish them. Let's use container types 'pcs-ez' and 'pcs-golden-image' for this purpose. | |||
Dmitry Guryanov | fd453d681ff | refactor code for implementing new template typeAbility to create instances from snapshot is needed, because now you can only create snapshot, but can't create a new instance from it. This paths does some preparation before implementing that functinality. * Make PCSTemplate base class and add EzTemplate class. * Move code for creating container to Template class (create_instance method) and add function get_template, which will select p... | |||
Dmitry Guryanov | b23c0b9432b | implement snapshot functionPCS support clone-to-template operation, which clones existing container to a container of special type. It, in turn, can be cloned later and the new container will be new auto-generated mac addresses on network adapter, new ID, new name, e.t.c. Image in glance is an array of data and metadata on form of key:value pairs. So we can't upload directory with container as-is. Let's use tar to conve... | |||
Dmitry Guryanov | 335ac80b70b | call unplug_vifs before plug_vifs in power_onOpenstack thinks that power_off operation will not destroy network interfaces and VM still will be connected to virtual port. So all other drivers don't call unplug_vifs in power_off and plug_vifs in power_on. If we will not call unplug/plug_vifs - veth devices will be destroyed on container shutdown, but port in openvswitch will be left and when veth device will appear this port will not work... | |||
root | 08698adf8ae | do set_ram_size together with set_resourcephyspages will not change if you set only PHYSPAGES parameter using ve.set_resource(PCR_PHYSPAGES, x). You also need to call set_ram_size. | |||
Dmitry Guryanov | 30c4ffb2a9f | apply flavor parameters to the containerTune number of cpus, memory, swap and root disk size. Since we create containers with vSwap memory model, memory and swap sizes simply map to the physpages and swappages container parameters. Containers are created with existing disk, so we have to do resize of the ploop disk after creating. | |||
Dmitry Guryanov | bd32855c603 | implement power_off/power_on operationsStop operation will shutdown container using ACPI, poweron - start it and connect veth device to the bridge. | |||
Dmitry Guryanov | 760a35eef6e | implement get_vnc_console operationBy default VNC is not started for containers and VMs in PCS. So we have to enable it, if it's not done before. First call to this function will start VNC server, subsequent ones - only get VNC port and return it. | |||
Dmitry Guryanov | 7f916abe2e4 | implement suspend/resume operationsThese operations calls corresponding functions from parallels SDK. Also resume operation calls plug_vifs to ensure, that instance is connected to network. | |||
Dmitry Guryanov | aa099eb1b78 | implement reboot operationImplement reboot operation. Now it only works if instance is started, so it has to be extended to all other possible states, because base ComputeDriver class requires it. | |||
Dmitry Guryanov | 08d5c3551be | keep host_ifname of veth during dhcp configurationYou have to provide --host_ifname together with --ifname to command, which tunes veth parameters, or interface name in the host will be changed to default vethXXX.X. | |||
Dmitry Guryanov | f6ae8b9635a | vif: don't plug iface to bridge, if it already therenova calls plug_vifs after start, but if an instance already started - iface could be plugged into bridge. So we have to check, if we really need to plug interface into bridge. | |||
Dmitry Guryanov | 3fb08213526 | add script for creating glance images from rpmsIt's very unconvenient to execute glance command with a lot of arguments to upload ez-template to glance. So add helper script, which will do all that work. Usage: ./utils/install-image.py <rpm file> | |||
Dmitry Guryanov | b6d042fbcc9 | create instances, based on images from glanceGlance will store rpm files of EZ templates. When you try to create an instance based on a image from glance, pcs driver will first retrieve info about rpm from glance: If the image has properties pcs_name, pcs_version and pcs_release - they will be used, if not - compute driver will download rpm and get name and version from an rpm file. If rpm is already installed and has the same or higher... | |||
Dmitry Guryanov | 7c8620568b3 | initial commit |