amazon web services - Properly setting DeleteOnTermination on an existing EBS volume using boto -


Digging through the code (for example, consider), I have found that I read using this feature I can:

  example.block_device_mapping ['/ dev / sdz']. Delete_on_termination   

... and toggle using it:

  example.modify_attribute ('Blockdevicemapping', ['/ dev / sdz = 1'] ) #Toggles for example Modify_attribute ('blockdevicemapping', ['/ dev / sdz']) # Toggle Off   

But it is one-symmetric and I think I'm missing some high level functionality .

It should not be more like:

  block_device_type = instance.block_device_mapping ['/ dev / sdz'] block_device_type.delete_on_termination = True block_device_type.save () # I This API   

?

You set this setting on and off formatted string '% s =% d' list.

Switch to

  & gt; & Gt; & Gt;  & Gt; & Gt; & Gt; Inst.modify_attribute ('blockDeviceMapping', ['/ dev / sda1 = 0'])   

I verified after every attempt to change the setting using the change outside of the Python Done:

  $ aws ec2 Description-Example-Attribute - Instance-ID-7890 BCD - Block Block Exception Mapping   
  1. Calling inst.modify_attribute ('BlockDeviceMapping', ['/ dev / sda1']) (lack of = 0 in the string) did not make any changes.
  2. .block_device_mapping ['/ dev / sda1'] to perform the installation. Delete_on_termination also did not make any changes. After calling

    modify_attribute , the value is unchanged at delete_on_termination on the local block device objects.


    I walk through the whole process here:


Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -