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

[3.6.1.0] add_machine does not respect series option #1254

Open
phvalguima opened this issue Feb 21, 2025 · 2 comments
Open

[3.6.1.0] add_machine does not respect series option #1254

phvalguima opened this issue Feb 21, 2025 · 2 comments
Labels
kind/bug indicates a bug in the project

Comments

@phvalguima
Copy link

phvalguima commented Feb 21, 2025

Description

Juju is ignoring my request for a jammy machine and setting up ubuntu 24.04 instead.

It seems to be a very similar bug to: #1229
However, seems that #1229, the user is trying to force 24.04 and getting 22.04 machines instead.

Not sure what caused the change.

Environment

OS: Ubuntu 24.04
Juju CLI: 3.6.2 (latest/stable as of now)
Juju Controller version: 3.6.2
libjuju: 3.6.1.0
LXD: 6.2

Using LXD cloud (localhost).

RPC Request

Once I run the add_machine call, I can see the following RPC request:

DEBUG:juju.client.connection:connection id: 131775709014464 ---> {
  "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": null                                         
      }                                                           
    ]                                                             
  },                                                              
  "request-id": 7                                                 
}                                                                 

Debug logs in the model: https://pastebin.ubuntu.com/p/j6xCZPB3c4/

Urgency

Annoying bug in our test suite

Python-libjuju version

3.6.1.0

Juju version

3.6.2

Reproduce / Test

# First, install libjuju:
sudo pip3 install juju==3.6.1.0


# Once that is finished, run the following python commands:
$ python3      
>>> from juju.model import Model                                       
>>> import asyncio                                                     
>>> model = Model()                                                    
>>> asyncio.run(model.connect(model_name="libjuju-issue"))  # Add your model name in this case
>>> model.name                                                         
'libjuju-issue'                                                        
>>> asyncio.run(model.add_machine(series="jammy"))
@phvalguima phvalguima added the kind/bug indicates a bug in the project label Feb 21, 2025
phvalguima added a commit to canonical/opensearch-dashboards-operator that referenced this issue Feb 21, 2025
Libjuju is ignoring series on `add_machine`, as reported in: juju/python-libjuju#1254

This PR fixes the CI run by moving from `add_machine` in libjuju to the actual juju CLI command.
@SimonRichardson
Copy link
Member

We should be using base (example: ubuntu@24.04) with 3.6. So we should check the facade version and ensure that we're sending base or series depending on that.

if series:
params.series = series

See:

_toSchema = {
"addresses": "addresses",
"base": "base",
"constraints": "constraints",
"container_type": "container-type",
"disks": "disks",
"hardware_characteristics": "hardware-characteristics",
"instance_id": "instance-id",
"jobs": "jobs",
"nonce": "nonce",
"parent_id": "parent-id",
"placement": "placement",
}

@dimaqq
Copy link
Contributor

dimaqq commented Feb 26, 2025

More context: #1229 (comment)

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

No branches or pull requests

3 participants