File: README.rst

package info (click to toggle)
python-vmmsclient 0.0.3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 136 kB
  • sloc: python: 559; makefile: 18; sh: 10
file content (111 lines) | stat: -rw-r--r-- 2,457 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
=====================
python-vmmsclient
=====================

Python client library and CLI plugin for the VM Migration Scheduler (VMMS) service.

Description
-----------

This package provides a Python client library and OpenStack CLI plugin for
interacting with the VM Migration Scheduler API. It allows users to schedule,
list, and manage virtual machine migrations through command-line interfaces
or programmatically.

Installation
------------

Install using pip::

    pip install python-vmmsclient

Prerequisites
-------------

- OpenStack environment with VMMS service deployed
- Valid OpenStack credentials
- python-openstackclient installed

CLI Usage
---------

Once installed, the vmms commands are available through the openstack CLI:

Add a VM for immediate migration::

    openstack vmms vm add <vm-id> <vm-name>

Add a VM for scheduled migration::

    openstack vmms vm add <vm-id> <vm-name> --schedule-time <ISO-timestamp>

List all VM migrations::

    openstack vmms vm list

Remove a VM migration::

    openstack vmms vm remove <migration-id>

Examples
--------

Add a VM for immediate migration::

    openstack vmms vm add 3d99ca07-92a2-4ff6-a0dc-2012adb57083 "my-test-vm"

Add a VM for scheduled migration::

    openstack vmms vm add 3d99ca07-92a2-4ff6-a0dc-2012adb57083 "scheduled-vm" \
        --schedule-time "2025-10-07T22:00:00Z"

List all migrations::

    openstack vmms vm list

Remove a migration::

    openstack vmms vm remove 123e4567-e89b-12d3-a456-426614174000

API Usage
---------

The client can also be used programmatically::

    from keystoneauth1.identity import v3
    from keystoneauth1 import session
    from vmmsclient.v2.client import Client

    # Create keystone session
    auth = v3.Password(auth_url='http://keystone:5000/v3',
                      username='admin',
                      password='password',
                      project_name='admin',
                      user_domain_name='Default',
                      project_domain_name='Default')
    sess = session.Session(auth=auth)

    # Create VMMS client
    client = Client(session=sess)

    # Add a VM migration
    migration = client.add_vm('vm-id', 'vm-name')

    # List migrations
    migrations = client.list_vms()

    # Remove a migration
    client.remove_vm('migration-id')

Development
-----------

Running tests::

    pip install -r test-requirements.txt
    stestr run

License
-------

Apache License, Version 2.0