Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't deploy [email protected] using add_machine #1229

Open
gboutry opened this issue Nov 29, 2024 · 10 comments
Open

Can't deploy [email protected] using add_machine #1229

gboutry opened this issue Nov 29, 2024 · 10 comments
Labels
juju/3.6 kind/bug indicates a bug in the project

Comments

@gboutry
Copy link
Contributor

gboutry commented Nov 29, 2024

Description

Model.add_machine takes only a series parameters, when using jammy, everything works as expected, but when using noble, the machine is still deployed as jammy

async def add_machine(

Urgency

Blocker for our release

Python-libjuju version

3.6.0.0

Juju version

3.6.0

Reproduce / Test

In a machine model supporting adding machines:

MAAS example

name = 'system-id=weBqr6'
await model.add_machine(spec=model.uuid + ":" + name, series="noble")
ubuntu@reproducer-gboutry-project-bastion:~$ juju machines -m openstack-machines
Machine  State    Address       Inst id                     Base          AZ       Message
0        started  10.149.73.19  reproducer-gboutry-hosts-0  [email protected]  default  Deployed
1        started  10.149.73.20  reproducer-gboutry-hosts-1  [email protected]  default  Deployed
2        started  10.149.73.21  reproducer-gboutry-hosts-2  [email protected]  default  Deployed
@gboutry gboutry added the kind/bug indicates a bug in the project label Nov 29, 2024
@gboutry
Copy link
Contributor Author

gboutry commented Nov 29, 2024

This might be an issue with the whole series to base migration?

@gboutry
Copy link
Contributor Author

gboutry commented Nov 29, 2024

Using the base [email protected] instead of series noble in series argument does not work either.

@dimaqq dimaqq added the juju/3.6 label Dec 2, 2024
@dimaqq
Copy link
Contributor

dimaqq commented Dec 2, 2024

The migration has not begun in this library.

The migration is already basically over in Juju, where the library uses the deprecated API fields.

The Juju team will often ask for jRPC dump, which you get by configuring Python logging:

    logging.basicConfig(level="INFO")
    logging.getLogger("juju.client.connection").setLevel("DEBUG")

@gboutry
Copy link
Contributor Author

gboutry commented Dec 2, 2024

[11:26:15] DEBUG    connection id: 140675648335328 ---> {                                                                                                                                                                               connection.py:564
                      "type": "MachineManager",                                                                                                                                                                                                          
                      "request": "AddMachines",                                                                                                                                                                                                          
                      "version": 10,                                                                                                                                                                                                                     
                      "params": {                                                                                                                                                                                                                        
                        "params": [                                                                                                                                                                                                                      
                          {                                                                                                                                                                                                                              
                            "addresses": [],                                                                                                                                                                                                             
                            "base": null,                                                                                                                                                                                                                
                            "constraints": null,                                                                                                                                                                                                         
                            "container-type": null,                                                                                                                                                                                                      
                            "disks": [],                                                                                                                                                                                                                 
                            "hardware-characteristics": null,                                                                                                                                                                                            
                            "instance-id": null,                                                                                                                                                                                                         
                            "jobs": [                                                                                                                                                                                                                    
                              "JobHostUnits"                                                                                                                                                                                                             
                            ],                                                                                                                                                                                                                           
                            "nonce": null,                                                                                                                                                                                                               
                            "parent-id": null,                                                                                                                                                                                                           
                            "placement": {                                                                                                                                                                                                               
                              "directive": "system-id=knabkt",                                                                                                                                                                                           
                              "scope": "0a70a0bb-b814-4bfd-8a97-be0953e3fd03"                                                                                                                                                                            
                            }                                                                                                                                                                                                                            
                          }                                                                                                                                                                                                                              
                        ]                                                                                                                                                                                                                                
                      },                                                                                                                                                                                                                                 
                      "request-id": 7                                                                                                                                                                                                                    
                    }                                                                                                                                                                                                                                    
           DEBUG    Pinger <Task pending name='Task_Pinger' coro=<Connection._pinger() running at /snap/openstack/x1/lib/python3.12/site-packages/juju/client/connection.py:521> wait_for=<Future pending cb=[Task.task_wakeup()]>>:    connection.py:513
                    pinging                                                                                                                                                                                                                              
           DEBUG    connection id: 140675647850592 ---> {                                                                                                                                                                               connection.py:564
                      "type": "Pinger",                                                                                                                                                                                                                  
                      "request": "Ping",                                                                                                                                                                                                                 
                      "version": 1,                                                                                                                                                                                                                      
                      "params": {},                                                                                                                                                                                                                      
                      "request-id": 7                                                                                                                                                                                                                    
                    }                                                                                                                                                                                                                                    
           DEBUG    Pinger <Task pending name='Task_Pinger' coro=<Connection._pinger() running at /snap/openstack/x1/lib/python3.12/site-packages/juju/client/connection.py:521> wait_for=<Future pending cb=[Task.task_wakeup()]>>:    connection.py:513
                    pinging                                                                                                                                                                                                                              
           DEBUG    connection id: 140675648335328 ---> {                                                                                                                                                                               connection.py:564
                      "type": "Pinger",                                                                                                                                                                                                                  
                      "request": "Ping",                                                                                                                                                                                                                 
                      "version": 1,                                                                                                                                                                                                                      
                      "params": {},                                                                                                                                                                                                                      
                      "request-id": 8                                                                                                                                                                                                                    
                    }                                                                                                                                                                                                                                    
           DEBUG    connection id : 140675647850592 <--- {'request-id': 7, 'response': {}}                                                                                                                                              connection.py:590
           DEBUG    connection id : 140675648335328 <--- {'request-id': 8, 'response': {}}                                                                                                                                              connection.py:590
           DEBUG    connection id : 140675648335328 <--- {'request-id': 7, 'response': {'machines': [{'machine': '0'}]}}                                                                                                                connection.py:590
           DEBUG    connection id : 140675648335328 <--- {'request-id': 6, 'response': {'deltas': [['machine', 'change', {'model-uuid': '0a70a0bb-b814-4bfd-8a97-be0953e3fd03', 'id': '0', 'instance-id': '', 'agent-status':           connection.py:590
                    {'current': 'pending', 'message': '', 'since': '2024-12-02T11:26:15.713037639Z', 'version': ''}, 'instance-status': {'current': 'pending', 'message': '', 'since': '2024-12-02T11:26:15.713037639Z', 'version':                      
                    ''}, 'life': 'alive', 'base': '[email protected]', 'container-type': '', 'supported-containers': None, 'supported-containers-known': False, 'jobs': ['JobHostUnits'], 'addresses': None, 'has-vote': False,                               
                    'wants-vote': False}]]}}                                                                                                                                                                                                             
           DEBUG    connection id: 140675648335328 ---> {                                                                                                                                                                               connection.py:564
                      "type": "AllWatcher",                                                                                                                                                                                                              
                      "request": "Next",                                                                                                                                                                                                                 
                      "version": 3,                                                                                                                                                                                                                      
                      "params": {},                                                                                                                                                                                                                      
                      "Id": "1",                                                                                                                                                                                                                         
                      "request-id": 9                                                                                                                                                                                                                    
                    } 

@gboutry
Copy link
Contributor Author

gboutry commented Dec 2, 2024

Looks like series is not transmitted on the rpc

@dimaqq
Copy link
Contributor

dimaqq commented Dec 2, 2024

I guess either support for base= needs to be added or facade version restricted to some older facade where series= argument is still available.

@gboutry
Copy link
Contributor Author

gboutry commented Dec 2, 2024

I think series=jammy worked by luck because that was the default by juju / maas, because looking at the _definitions.py, series has not been in there for a while.

@dimaqq
Copy link
Contributor

dimaqq commented Dec 3, 2024

I'm confirming the above.

The series= kwarg did not work for quite a while.

It has disappeared between 3.0.2 and 3.0.3:

3.0.2...3.0.3#diff-28797347270467fe3dcb301f7927c3b5eae6bce5732e7c59aa69bc10cc658845

What folks were getting was the default that given Juju model deployed on.

I'm not perfectly clear, but I think this can be worked around by either of:

juju model-config [email protected]
juju model-config default-series=noble

There's always the alternative to shell out to juju cli to create machines for testing.

P.S. I'm working on general series to base transition in #1182 but that's still going to take a while.

@SimonRichardson
Copy link
Member

@dimaqq Is correct, although that's less than ideal.

@gboutry
Copy link
Contributor Author

gboutry commented Dec 3, 2024

Thanks for your input, I'll switch add-machine calls with juju cli calls instead for the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
juju/3.6 kind/bug indicates a bug in the project
Projects
None yet
Development

No branches or pull requests

3 participants