[OneSwap] Conversion fails with NoMethodError in add_one_nics when guest IPs are known
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- ruby
- Domain
- cloud, networking
Research direction
Start with add_one_nics in oneswap_helper.rb, especially the reported lines 3563 and 4062–4091, and trace how net_templ is built under netkey before the success message reads NETWORK_ID. Reproduce with a vCenter VM that reports guest IPs, using --network without --skip-ip; done means the NIC is added with the guest IP and the VM template is created without the NoMethodError.
Written by the indexing model from the issue text.
Description
Description
When a conversion runs with --network, vCenter reports guest IP addresses for a NIC, and --skip-ip is not set, OneSwap fails while adding the NICs to the VM template:
Creating AR for IP <ip>...Success
Error: undefined method '[]' for nil
In add_one_nics, the per-IP loop builds net_templ under the key held in netkey (NIC_ALIAS for the first address, NETWORK_ALIAS after that). The success message then reads net_templ['NIC']['NETWORK_ID']. In that branch net_templ['NIC'] is nil, so the puts raises right after the address range has been added to the virtual network.
- 7.4.1:
oneswap_helper.rb:3563
To Reproduce
- Pick a vCenter VM for which vCenter reports guest IPs (
guest.net[].ipConfig.ipAddress). - Convert it with a target network and without
--skip-ip, e.g.oneswap convert <vm> $VOPTS --network <vnet-id>. - The disk conversion and image import succeed. The run then fails while adding the NIC, with the error above.
Expected behavior
The NIC is added with the guest's IP, and the VM template is created.
Details
- Affected Component: OneSwap
- Hypervisor: KVM
- Version: 7.4.1 (still present on master, dd172c0)
Additional context
add_one_nics runs after the images are imported oneswap_helper.rb:5130. A failure here leaves the new images in OpenNebula with no VM template, and the address range that was just added stays in the virtual network.
The fix should probably also cover these other problems in the same block oneswap_helper.rb:4062-4091
Progress Status
- Code committed
- Testing - QA
- Documentation (Release notes - resolved issues, compatibility, known issues)
- Dominant language
- JavaScript
- Stars
- 1.7k
- Forks
- 534
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from OpenNebula/one
-
Sunstone truncates VM names containing mixed ASCII and non-ASCII characters in paginated VM poolOpenStatus: Pending
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
OpenNebula/one#8210 · 1 comment ·
-
Category: Sunstone Priority: Normal Status: Accepted
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
OpenNebula/one#8207 · 1 comment ·
-
[OneSwap] Delta migration treats CD-ROM emptyBackingString as an active diskPossibly taken @ryatsyshyn claimed this 19 days ago. OpenCategory: OneSwap Status: Pending
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
OpenNebula/one#8170 · 3 comments · 1 assignee ·
-
Fix datastore.conf path in backup documentPossibly taken @mattrowe-opennebula claimed this 11 days ago. OpenCategory: Documentation Priority: Normal Status: Accepted
Difficulty 1/5 Under an hour Newbie friendliness 86/100
OpenNebula/one#8150 · 2 assignees ·
-
Status: Pending
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
OpenNebula/one#8139 ·
Similar issues
-
Let TypeScript accept an initial object in ReactiveDictPossibly taken @yograj-vijay-yadav claimed this today. Openbug good first issue help wanted workshop
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
meteor/meteor#14919 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
akitaonrails/FrankMD#268 ·
Maintainers usually reply within 1 day
-
account: profile
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 5 days
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
mfreed7/xslt_polyfill#65 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day