The built-in named 'file' has been removed since Python 3.0 [1]
This patch replaces it by 'open' which is the same under Python 2 and 3.
[1] https://docs.python.org/release/3.0/whatsnew/3.0.html#builtins
Change-Id: Id39efad099358a76743693cc6e32bddca57e8e45
As uploading image, it will compress the vdh file and generate the
gzipped tar file. This commit will change it to use default compress
level as 6; and also allow the API's user to specify a customizing
compress level basing on demand.
Change-Id: If343326d7a501b25662fecb0b57d7637acabe250
In XenServer's dom0 (e.g. XS7.0/7.1), the module of future is
not available. So this commit is to avoid using *future*. Instead
it import check_output from different modules basing if *future*
module is available of not.
Change-Id: Ib75b2b7965e63033ea933f7cb4a4a54a2f48ef75
Partial-Bug: #1762130
If the SR is not the default one, the nova option of "sr_matching_filter"
can be used to get proper SR. In order to support it with VDI streaming,
we should add a new parameter - sr_ref which will be passed down by
nova code.
Change-Id: I624ee58f9c630f1712e066f3523ee6db45775e5c
We had some change in source code (glance.py) to make os-xenapi
be compitable with both py2 and py3. But the modules in the UT
have not been changed accordingly. So some mocks on module's
method don't take effective.
This commit is to fix the failures in test_glance.
Change-Id: I42cbe4f5dc5cec5d28394b9502196ff9c9bb8761
Closes-Bug: 1757928
We usually use a period-separated hierarchical module name as
the logger's name. But we have three scripts are using a hardcoded
name. This commit is to change them to use __name__ to make them
consistent with others. By using the period-separated hierarchical
module name, it's easier to know which module generated the log
lines so it's also easier to get the file name.
Change-Id: I373ce9b44caf2b9baffb753e6db7ad8789219f4b
Fixes os_xenapi/dom0/etc/xapi.d/plugins/*.py wrt Python 3 compatibility,
also remove some tests in os_xenapi/tests/plugins/test_glance.py that
are too Py2 centric.
Change-Id: Iab721f6a47dc023f01670076ef7d1de107a913ae
Sometime we need to know if a domu's interface is conneted
to a same bridge (network) as dom0's interface. This commit
is to add bridge name for each ipv4 entry in the xenapi facts.
Change-Id: I8a6e1507cfa2c935b18e2fed04abaa06df9b0e51
This commit is to gather domU's vifs in facts. So that the compute
VM's interfaces' vif information will be included in the xenapi_facts.
When deploy OpenStack on XenServers, the vif information can be used
by deployment scripts (e.g. in Kolla-ansible, it can use the vif's
bridge to support provider networks by setting the bridge mappings).
Change-Id: I9a6bebe19ed488bb2173d5dc2daa14e236411243
This commit introduces a command which can be invoked by kolla
playbook to bootstrap XenAPI - xenapi_bootstrap. This command
will invoke some modules's functions to do needed boostrap
tasks. At the moment it includes:
* configure himn
* configure iptalbes to allow traffic
* install xapi plugins to dom0
* gather XenAPI facts and save them into a file
The facts file will used others e.g. kolla deployment can
get facts from it and populate relative configures basing
on the facts.
Change-Id: Ie2d7d40f2755580aac4a10f3d302190a8bd4fe6f
This commit is to add dom0's IPs in the xenapi facts. So that
kolla-ansible can use the proper IP address for vxlan tunnel or
other places when require dom0's IPs.
Change-Id: Iede11b4a529ff1885b588bf01d7ff15dc6185092
This commit contains the following changes:
1. remove it from cmd; as there is no need to expose this as a
separate command. Making this as an util which will be invoked
by xenapi_bootstrap.
2. rename the general function of get_hostname to be get_remote_hostname
and move it to common_functions.
3. change the keywords for the facts items to make it more clear.
Change-Id: Ie786b3085c29f9a1faf2c51a1a704ded1010af7b
When deploy OpenStack on XenServer, we need install some XAPI
plugins to dom0. This commit is to add utils for this purpose.
If the os-xenapi version is different from the os-xenapi which
contains the utils. Users can specify the version to the utils.
So that the utils will download the right version of os-xenapi
and copy plugins from there. Otherwise the utils will by default
copy plugins from current installed packages.
Change-Id: I269a444b952f63fd73b3825b23dc95d6e825ce8f
This commit is to add a new command - get_xenapi_facts
which will gather facts for XenAPI. When deploy OpenStack
on XenServer, the facts can be used by deploy approach(e.g.
kolla-ansible).
Change-Id: Ia606d6ddc651cfa0b75fa34d8f14bc156d9dbe27
Add utils to do HIMN configuration. If the local HIMN interface
is up and gets IP address allocated, we can get the interface
via checking if the local interface has an IP belong to the same
network as the dom0's HIMN IP which should be supplied. Otherwise
read xenstore to get mac address and find the interface via mac.
After identified the interface, we populate the ifcfg file to
ensure this interface will be up in the future across boots.
Change-Id: I5f8cd53710edb714f0c4c1dc50c1d4472f2e365f
Depends-on: Ia363afc1fc932bf44a7ac956a5bc27978bb47868
This is to introduce a new utility which can be used by other
scripts to setup ssh connection to remote hosts and run commands
remotely or copy files to remote hosts via scp.
Change-Id: Ia363afc1fc932bf44a7ac956a5bc27978bb47868
In pooled environment, there would be an error when we create a
VM with configure driver on slave hosts. It is happened because
the streaming connection is created between slave compute node and
master Dom0. Change the connection back to slave Dom0 to fix this
error.
Change-Id: I02a740be3acf8973b6a324cf3563e427fc11534b
The image_id argument is not used anymore, but I still passed it
to `_update_image_meta_v2` function, which lead to a tempest test
error. This patch is used to fix this error.
Modify the unit test to prevent similar issues.
Change-Id: I8cb9f6bd31f2f3ac2e4688253aee255b774f1b69
This is to support streaming VHD tgz files to/from XAPI. In
this way, it will avoid the restriction that SRs must be
file system based SR (e.g. ext and nfs) for XenServer
OpenStack. So that we can support other types of SRs
e.g. lvm, iscsi and etc.
Change-Id: I2cfe7340d48071bf96bc7ba0ad19f5a0b12b5378
In XS7.x, sfdisk V2.23 is installed. But there is a bug which
causing it complaining wrong cylinder number is specified for
the partition's end. And that bug has been fixed since 2.26.
At here the solution is to use the option of '--force" before
V2.26.
Change-Id: I5f1a3c182ee1874383bd5f0cecbad18d96e8b58f
Closes-Bug: #1701153
Need to complete implementation for XAPI pools
Fix os-xenapi client session couldn't connect to xapi pool slave
issue. Now multi-node openstack envrionment could boot up VM on
slave node.
There are also many old unit test be broken, modify it to fit
new code changes
Change-Id: Ie1b49a206b57219083059871f326926cc4628142
Need change xenapi code to fit the change that glance-api switched
to uwsgi and add back the glance relative tests. Use urlparser to
get the suffix of the endepoint to build the http url. Using it in
glance service request in order to specify glance service
Change-Id: I5abdba24dc77c165100ba7d20cc731ce6076a4c7
There is an exception thrown out during xapi pool test, which caused
by a urllib parse gramatical error
Change-Id: I1354ff52b8d6567a5d31ee3842372f6a1f6fae0c