Skip to content

Instantly share code, notes, and snippets.

@michaeltchapman
Created March 30, 2014 15:11
Show Gist options
  • Save michaeltchapman/9874191 to your computer and use it in GitHub Desktop.
Save michaeltchapman/9874191 to your computer and use it in GitHub Desktop.
[root@control1 ~]# puppet apply test.pp
Notice: Compiled catalog for control1.domain.name in environment production in 0.09 seconds
Notice: /Stage[main]/Main/Nova_aggregate[test_agg]/ensure: created
Notice: Finished catalog run in 3.08 seconds
[root@control1 ~]# nova aggregate-remove-host test_agg compute1
Host compute1 has been successfully removed from aggregate 3
+----+----------+-------------------+-------+-------------------------+
| Id | Name | Availability Zone | Hosts | Metadata |
+----+----------+-------------------+-------+-------------------------+
| 3 | test_agg | - | | 'gpu=False', 'ssd=True' |
+----+----------+-------------------+-------+-------------------------+
[root@control1 ~]# nova aggregate-delete test_agg
Aggregate 3 has been successfully deleted.
[root@control1 ~]# puppet apply test.pp
Notice: Compiled catalog for control1.domain.name in environment production in 0.09 seconds
Notice: /Stage[main]/Main/Nova_aggregate[test_agg]/ensure: created
Notice: Finished catalog run in 3.12 seconds
[root@control1 ~]# nova aggregate-remove-host test_agg compute1
Host compute1 has been successfully removed from aggregate 4
+----+----------+-------------------+-------+-------------------------+
| Id | Name | Availability Zone | Hosts | Metadata |
+----+----------+-------------------+-------+-------------------------+
| 4 | test_agg | - | | 'gpu=False', 'ssd=True' |
+----+----------+-------------------+-------+-------------------------+
[root@control1 ~]# puppet apply test.pp
Notice: Compiled catalog for control1.domain.name in environment production in 0.11 seconds
Error: undefined method `each' for "":Puppet::Util::Execution::ProcessOutput
Error: /Stage[main]/Main/Nova_aggregate[test_agg]/hosts: change from to compute1 failed: undefined method `each' for "":Puppet::Util::Execution::ProcessOutput
Notice: Finished catalog run in 2.66 seconds
nova_aggregate { 'test_agg':
metadata => 'ssd=True,gpu=False',
hosts => 'compute1'
}
@toabctl
Copy link

toabctl commented Mar 31, 2014

I tried the same procedure and this works for me:

vagrant@devstack1:~$ nova aggregate-list
+----+------+-------------------+
| Id | Name | Availability Zone |
+----+------+-------------------+
+----+------+-------------------+
vagrant@devstack1:~$ sudo puppet apply test.pp
Notice: Compiled catalog for devstack1.local in environment production in 0.02 seconds
Notice: /Stage[main]/Main/Nova_aggregate[test_agg]/ensure: created
Notice: Finished catalog run in 2.83 seconds
vagrant@devstack1:~$ nova aggregate-details 4
+----+----------+-------------------+-------------+-------------------------+
| Id | Name     | Availability Zone | Hosts       | Metadata                |
+----+----------+-------------------+-------------+-------------------------+
| 4  | test_agg | -                 | 'devstack1' | 'gpu=False', 'ssd=True' |
+----+----------+-------------------+-------------+-------------------------+
vagrant@devstack1:~$ nova aggregate-remove-host test_agg devstack1
Host devstack1 has been successfully removed from aggregate 4 
+----+----------+-------------------+-------+-------------------------+
| Id | Name     | Availability Zone | Hosts | Metadata                |
+----+----------+-------------------+-------+-------------------------+
| 4  | test_agg | -                 |       | 'gpu=False', 'ssd=True' |
+----+----------+-------------------+-------+-------------------------+
vagrant@devstack1:~$ nova aggregate-delete test_agg
Aggregate 4 has been successfully deleted.
vagrant@devstack1:~$ sudo puppet apply test.pp
Notice: Compiled catalog for devstack1.local in environment production in 0.02 seconds
Notice: /Stage[main]/Main/Nova_aggregate[test_agg]/ensure: created
Notice: Finished catalog run in 2.83 seconds
vagrant@devstack1:~$ nova aggregate-details 5
+----+----------+-------------------+-------------+-------------------------+
| Id | Name     | Availability Zone | Hosts       | Metadata                |
+----+----------+-------------------+-------------+-------------------------+
| 5  | test_agg | -                 | 'devstack1' | 'gpu=False', 'ssd=True' |
+----+----------+-------------------+-------------+-------------------------+
vagrant@devstack1:~$ nova aggregate-remove-host test_agg devstack1
Host devstack1 has been successfully removed from aggregate 5 
+----+----------+-------------------+-------+-------------------------+
| Id | Name     | Availability Zone | Hosts | Metadata                |
+----+----------+-------------------+-------+-------------------------+
| 5  | test_agg | -                 |       | 'gpu=False', 'ssd=True' |
+----+----------+-------------------+-------+-------------------------+
vagrant@devstack1:~$ sudo puppet apply test.pp
Notice: Compiled catalog for devstack1.local in environment production in 0.02 seconds
Notice: /Stage[main]/Main/Nova_aggregate[test_agg]/hosts: hosts changed '' to 'devstack1'
Notice: Finished catalog run in 3.22 seconds
vagrant@devstack1:~$ nova aggregate-details 5
+----+----------+-------------------+-------------+-------------------------+
| Id | Name     | Availability Zone | Hosts       | Metadata                |
+----+----------+-------------------+-------------+-------------------------+
| 5  | test_agg | -                 | 'devstack1' | 'gpu=False', 'ssd=True' |
+----+----------+-------------------+-------------+-------------------------+
vagrant@devstack1:~$

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment